KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > dd > EjbJarDDObjectFactory


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.ejb3.dd;
8
9 import java.util.StringTokenizer JavaDoc;
10
11 import org.xml.sax.Attributes JavaDoc;
12 import org.jboss.logging.Logger;
13 import org.jboss.xb.binding.UnmarshallingContext;
14 import org.jboss.xb.binding.ObjectModelFactory;
15
16 /**
17  * org.jboss.xml.binding.ObjectModelFactory implementation that accepts data
18  * chuncks from unmarshaller and assembles them into an EjbJarDD instance.
19  *
20  * @author <a HREF="mailto:bdecoste@jboss.com">William DeCoste</a>
21  * @version <tt>$Revision: 1.19.2.2 $</tt>
22  */

23 public class EjbJarDDObjectFactory implements ObjectModelFactory
24 {
25
26    private static final Logger log = Logger
27          .getLogger(EjbJarDDObjectFactory.class);
28
29    /**
30     * Return the root.
31     */

32    public Object JavaDoc newRoot(Object JavaDoc root, UnmarshallingContext navigator,
33          String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
34    {
35
36       final EjbJarDD dd;
37       if (root == null)
38       {
39          root = dd = new EjbJarDD();
40       } else
41       {
42          dd = (EjbJarDD) root;
43       }
44
45       if (attrs.getLength() > 0)
46       {
47          for (int i = 0; i < attrs.getLength(); ++i)
48          {
49             if (attrs.getLocalName(i).equals("version"))
50             {
51                dd.setVersion(attrs.getValue(i));
52             }
53          }
54       }
55
56       return root;
57    }
58
59    public Object JavaDoc completeRoot(Object JavaDoc root, UnmarshallingContext ctx,
60          String JavaDoc uri, String JavaDoc name)
61    {
62       return root;
63    }
64
65    // Methods discovered by introspection
66

67    /**
68     * Called when parsing of a new element started.
69     */

70    public Object JavaDoc newChild(EjbJarDD dd, UnmarshallingContext navigator,
71          String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
72    {
73       Object JavaDoc child = null;
74
75       if (localName.equals("enterprise-beans"))
76       {
77          child = new EnterpriseBeans();
78       } else if (localName.equals("relationships"))
79       {
80          child = new Relationships();
81       } else if (localName.equals("assembly-descriptor"))
82       {
83          child = new AssemblyDescriptor();
84       }
85
86       return child;
87    }
88
89    /**
90     * Called when parsing of a new element started.
91     */

92    public Object JavaDoc newChild(EnterpriseBeans ejbs, UnmarshallingContext navigator,
93          String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
94    {
95       Object JavaDoc child = null;
96
97       if (localName.equals("session"))
98       {
99          child = new SessionEnterpriseBean();
100       } else if (localName.equals("entity"))
101       {
102          child = new EntityEnterpriseBean();
103       } else if (localName.equals("message-driven"))
104       {
105          child = new MessageDrivenBean();
106       }
107
108       return child;
109    }
110
111    /**
112     * Called when parsing of a new element started.
113     */

114    private Object JavaDoc newEjbChild(EnterpriseBean parent, String JavaDoc localName)
115    {
116       Object JavaDoc child = null;
117
118       if (localName.equals("ejb-local-ref"))
119       {
120          child = new EjbLocalRef();
121       } else if (localName.equals("ejb-ref"))
122       {
123          child = new EjbRef();
124       } else if (localName.equals("resource-ref"))
125       {
126          child = new ResourceRef();
127       } else if (localName.equals("env-entry"))
128       {
129          child = new EnvEntry();
130       } else if (localName.equals("message-destination-ref"))
131       {
132          child = new MessageDestinationRef();
133       }
134
135       return child;
136    }
137    
138    /**
139     * Called when parsing of a new element started.
140     */

141    public Object JavaDoc newChild(MessageDrivenBean parent,
142          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
143          Attributes JavaDoc attrs)
144    {
145       Object JavaDoc child = null;
146
147       child = newEjbChild(parent, localName);
148       if (child == null)
149       {
150          if (localName.equals("message-driven-destination"))
151          {
152             child = new MessageDrivenDestination();
153          }
154       }
155
156       return child;
157    }
158
159    /**
160     * Called when parsing of a new element started.
161     */

162    public Object JavaDoc newChild(SessionEnterpriseBean parent,
163          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
164          Attributes JavaDoc attrs)
165    {
166       Object JavaDoc child = null;
167
168       child = newEjbChild(parent, localName);
169       if (child == null)
170       {
171          if (localName.equals("security-identity"))
172          {
173             child = new SecurityIdentity();
174          }
175       }
176
177       return child;
178    }
179
180    /**
181     * Called when parsing of a new element started.
182     */

183    public Object JavaDoc newChild(EntityEnterpriseBean parent,
184          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
185          Attributes JavaDoc attrs)
186    {
187       Object JavaDoc child = null;
188
189       child = newEjbChild(parent, localName);
190       if (child == null)
191       {
192          if (localName.equals("cmp-field"))
193          {
194             child = new CmpField();
195          } else if (localName.equals("query"))
196          {
197             child = new Query();
198          }
199       }
200
201       return child;
202    }
203
204    /**
205     * Called when parsing of a new element started.
206     */

207    public Object JavaDoc newChild(SecurityIdentity parent,
208          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
209          Attributes JavaDoc attrs)
210    {
211       Object JavaDoc child = null;
212
213       if (localName.equals("use-caller-identity"))
214       {
215          parent.setUseCallerIdentity(true);
216       }
217
218       return child;
219    }
220
221    /**
222     * Called when parsing of a new element started.
223     */

224    public Object JavaDoc newChild(Relationships relationships,
225          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
226          Attributes JavaDoc attrs)
227    {
228       Object JavaDoc child = null;
229
230       if (localName.equals("ejb-relation"))
231       {
232          child = new EjbRelation();
233       }
234
235       return child;
236    }
237
238    /**
239     * Called when parsing of a new element started.
240     */

241    public Object JavaDoc newChild(EjbRelation relation, UnmarshallingContext navigator,
242          String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
243    {
244       Object JavaDoc child = null;
245
246       if (localName.equals("ejb-relationship-role"))
247       {
248          child = new EjbRelationshipRole();
249       }
250
251       return child;
252    }
253
254    /**
255     * Called when parsing of a new element started.
256     */

257    public Object JavaDoc newChild(EjbRelationshipRole parent,
258          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
259          Attributes JavaDoc attrs)
260    {
261       Object JavaDoc child = null;
262
263       if (localName.equals("cascade-delete"))
264       {
265          parent.setCascadeDelete(true);
266       } else if (localName.equals("relationship-role-source"))
267       {
268          child = new RelationshipRoleSource();
269       } else if (localName.equals("cmr-field"))
270       {
271          child = new CmrField();
272       }
273
274       return child;
275    }
276
277    /**
278     * Called when parsing of a new element started.
279     */

280    public Object JavaDoc newChild(AssemblyDescriptor relationships,
281          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
282          Attributes JavaDoc attrs)
283    {
284       Object JavaDoc child = null;
285
286       if (localName.equals("security-role"))
287       {
288          child = new SecurityRole();
289       } else if (localName.equals("method-permission"))
290       {
291          child = new MethodPermission();
292       }
293       if (localName.equals("container-transaction"))
294       {
295          child = new ContainerTransaction();
296       } else if (localName.equals("inject"))
297       {
298          child = new Inject();
299       } else if (localName.equals("callback"))
300       {
301          child = new Callback();
302       } else if (localName.equals("exclude-list"))
303       {
304          child = new ExcludeList();
305       } else if (localName.equals("remove-list"))
306       {
307          child = new RemoveList();
308       } else if (localName.equals("init-list"))
309       {
310          child = new InitList();
311       }
312
313       return child;
314    }
315    
316    /**
317     * Called when parsing of a new element started.
318     */

319    public Object JavaDoc newChild(Inject inject,
320          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
321          Attributes JavaDoc attrs)
322    {
323       Object JavaDoc child = null;
324
325       if (localName.equals("method"))
326       {
327          child = new Method();
328       }
329
330       return child;
331    }
332    
333    /**
334     * Called when parsing of a new element started.
335     */

336    public Object JavaDoc newChild(Callback callback,
337          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
338          Attributes JavaDoc attrs)
339    {
340       Object JavaDoc child = null;
341
342       if (localName.equals("method"))
343       {
344          child = new Method();
345       }
346
347       return child;
348    }
349
350    /**
351     * Called when parsing of a new element started.
352     */

353    public Object JavaDoc newChild(MethodPermission permission,
354          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
355          Attributes JavaDoc attrs)
356    {
357       Object JavaDoc child = null;
358
359       if (localName.equals("method"))
360       {
361          child = new Method();
362       } else if (localName.equals("unchecked"))
363       {
364          permission.setUnchecked(true);
365       }
366
367       return child;
368    }
369    
370    /**
371     * Called when parsing of a new element started.
372     */

373    public Object JavaDoc newChild(ExcludeList list,
374          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
375          Attributes JavaDoc attrs)
376    {
377       Object JavaDoc child = null;
378
379       if (localName.equals("method"))
380       {
381          child = new Method();
382       }
383
384       return child;
385    }
386    
387    /**
388     * Called when parsing of a new element started.
389     */

390    public Object JavaDoc newChild(RemoveList list,
391          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
392          Attributes JavaDoc attrs)
393    {
394       Object JavaDoc child = null;
395
396       if (localName.equals("method"))
397       {
398          child = new Method();
399       }
400
401       return child;
402    }
403    
404    /**
405     * Called when parsing of a new element started.
406     */

407    public Object JavaDoc newChild(InitList list,
408          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
409          Attributes JavaDoc attrs)
410    {
411       Object JavaDoc child = null;
412
413       if (localName.equals("method"))
414       {
415          child = new Method();
416       }
417
418       return child;
419    }
420
421    /**
422     * Called when parsing of a new element started.
423     */

424    public Object JavaDoc newChild(ContainerTransaction transaction,
425          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
426          Attributes JavaDoc attrs)
427    {
428       Object JavaDoc child = null;
429
430       if (localName.equals("method"))
431       {
432          child = new Method();
433       }
434
435       return child;
436    }
437
438    /**
439     * Called when parsing character is complete.
440     */

441    public void addChild(EjbJarDD parent, EnterpriseBeans ejbs,
442          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
443    {
444       parent.setEnterpriseBeans(ejbs);
445    }
446
447    /**
448     * Called when parsing character is complete.
449     */

450    public void addChild(EnterpriseBeans parent, EnterpriseBean ejb,
451          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
452    {
453       parent.addEnterpriseBean(ejb);
454    }
455
456    /**
457     * Called when parsing character is complete.
458     */

459    public void addChild(SessionEnterpriseBean parent, SecurityIdentity si,
460          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
461    {
462       parent.setSecurityIdentity(si);
463    }
464
465    /**
466     * Called when parsing character is complete.
467     */

468    public void addChild(SessionEnterpriseBean parent, EjbLocalRef ref,
469          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
470    {
471       parent.addEjbLocalRef(ref);
472    }
473
474    /**
475     * Called when parsing character is complete.
476     */

477    public void addChild(SessionEnterpriseBean parent, EjbRef ref,
478          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
479    {
480       parent.addEjbRef(ref);
481    }
482    
483    /**
484     * Called when parsing character is complete.
485     */

486    public void addChild(SessionEnterpriseBean parent, MessageDestinationRef ref,
487          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
488    {
489       parent.addMessageDestinationRef(ref);
490    }
491    
492    /**
493     * Called when parsing character is complete.
494     */

495    public void addChild(SessionEnterpriseBean parent, EnvEntry entry,
496          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
497    {
498       parent.addEnvEntry(entry);
499    }
500
501    /**
502     * Called when parsing character is complete.
503     */

504    public void addChild(SessionEnterpriseBean parent, ResourceRef ref,
505          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
506    {
507       parent.addResourceRef(ref);
508    }
509
510    /**
511     * Called when parsing character is complete.
512     */

513    public void addChild(EntityEnterpriseBean parent, CmpField field,
514          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
515    {
516       parent.addCmpField(field);
517    }
518
519    /**
520     * Called when parsing character is complete.
521     */

522    public void addChild(EntityEnterpriseBean parent, Query query,
523          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
524    {
525       parent.addQuery(query);
526    }
527
528    /**
529     * Called when parsing character is complete.
530     */

531    public void addChild(EjbJarDD parent, Relationships relationships,
532          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
533    {
534       parent.setRelationships(relationships);
535    }
536
537    /**
538     * Called when parsing character is complete.
539     */

540    public void addChild(Relationships parent, EjbRelation relation,
541          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
542    {
543       parent.addEjbRelation(relation);
544    }
545
546    /**
547     * Called when parsing character is complete.
548     */

549    public void addChild(EjbRelation parent, EjbRelationshipRole role,
550          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
551    {
552       parent.addEjbRelationshipRole(role);
553    }
554
555    /**
556     * Called when parsing character is complete.
557     */

558    public void addChild(EjbRelationshipRole parent,
559          RelationshipRoleSource source, UnmarshallingContext navigator,
560          String JavaDoc namespaceURI, String JavaDoc localName)
561    {
562       parent.setRelationshipRoleSource(source);
563    }
564
565    /**
566     * Called when parsing character is complete.
567     */

568    public void addChild(EjbRelationshipRole parent, CmrField field,
569          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
570    {
571       parent.setCmrField(field);
572    }
573
574    /**
575     * Called when parsing character is complete.
576     */

577    public void addChild(EjbJarDD parent, AssemblyDescriptor descriptor,
578          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
579    {
580       parent.setAssemblyDescriptor(descriptor);
581    }
582
583    /**
584     * Called when parsing character is complete.
585     */

586    public void addChild(AssemblyDescriptor parent, SecurityRole role,
587          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
588    {
589       parent.addSecurityRole(role);
590    }
591
592    /**
593     * Called when parsing character is complete.
594     */

595    public void addChild(AssemblyDescriptor parent, MethodPermission permission,
596          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
597    {
598       parent.addMethodPermission(permission);
599    }
600    
601    /**
602     * Called when parsing character is complete.
603     */

604    public void addChild(AssemblyDescriptor parent, ExcludeList list,
605          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
606    {
607       parent.setExcludeList(list);
608    }
609    
610    /**
611     * Called when parsing character is complete.
612     */

613    public void addChild(AssemblyDescriptor parent, RemoveList list,
614          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
615    {
616       parent.setRemoveList(list);
617    }
618    
619    /**
620     * Called when parsing character is complete.
621     */

622    public void addChild(AssemblyDescriptor parent, InitList list,
623          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
624    {
625       parent.setInitList(list);
626    }
627    
628    /**
629     * Called when parsing character is complete.
630     */

631    public void addChild(AssemblyDescriptor parent, Inject inject,
632          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
633    {
634       parent.addInject(inject);
635    }
636    
637    /**
638     * Called when parsing character is complete.
639     */

640    public void addChild(AssemblyDescriptor parent, Callback callback,
641          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
642    {
643       parent.addCallback(callback);
644    }
645    
646    /**
647     * Called when parsing character is complete.
648     */

649    public void addChild(ExcludeList parent, Method method,
650          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
651    {
652       parent.addMethod(method);
653    }
654    
655    /**
656     * Called when parsing character is complete.
657     */

658    public void addChild(RemoveList parent, Method method,
659          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
660    {
661       parent.addMethod(method);
662    }
663    
664    /**
665     * Called when parsing character is complete.
666     */

667    public void addChild(InitList parent, Method method,
668          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
669    {
670       parent.addMethod(method);
671    }
672
673    /**
674     * Called when parsing character is complete.
675     */

676    public void addChild(MethodPermission parent, Method method,
677          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
678    {
679       parent.addMethod(method);
680    }
681    
682    /**
683     * Called when parsing character is complete.
684     */

685    public void addChild(Inject parent, Method method,
686          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
687    {
688       parent.addMethod(method);
689    }
690    
691    /**
692     * Called when parsing character is complete.
693     */

694    public void addChild(Callback parent, Method method,
695          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
696    {
697       parent.addMethod(method);
698    }
699
700    /**
701     * Called when parsing character is complete.
702     */

703    public void addChild(AssemblyDescriptor parent,
704          ContainerTransaction transaction, UnmarshallingContext navigator,
705          String JavaDoc namespaceURI, String JavaDoc localName)
706    {
707       parent.addContainerTransaction(transaction);
708    }
709
710    /**
711     * Called when parsing character is complete.
712     */

713    public void addChild(ContainerTransaction parent, Method method,
714          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
715    {
716       parent.setMethod(method);
717    }
718    
719    /**
720     * Called when parsing character is complete.
721     */

722    public void addChild(MessageDrivenBean parent, MessageDrivenDestination destination,
723          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
724    {
725       parent.setMessageDrivenDestination(destination);
726    }
727
728    /**
729     * Called when a child element with simple content is read for DD.
730     */

731    public void setValue(EjbJarDD dd, UnmarshallingContext navigator,
732          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
733    {
734       if (localName.equals("display-name"))
735       {
736          dd.setDisplayName(value);
737       }
738    }
739
740    /**
741     * Called when a child element with simple content is read for DD.
742     */

743    private boolean isEjbParentName(EnterpriseBean ejb, String JavaDoc localName,
744          String JavaDoc value)
745    {
746       if (localName.equals("ejb-name"))
747       {
748          ejb.setEjbName(value);
749          return true;
750       } else if (localName.equals("home"))
751       {
752          ejb.setHome(value);
753          return true;
754       } else if (localName.equals("remote"))
755       {
756          ejb.setRemote(value);
757          return true;
758       } else if (localName.equals("local-home"))
759       {
760          ejb.setLocalHome(value);
761          return true;
762       } else if (localName.equals("local"))
763       {
764          ejb.setLocal(value);
765          return true;
766       } else if (localName.equals("ejb-class"))
767       {
768          ejb.setEjbClass(value);
769          return true;
770       } else if (localName.equals("callback-listener"))
771       {
772          ejb.addCallbackListener(value);
773          return true;
774       } else if (localName.equals("interceptor"))
775       {
776          ejb.addInterceptor(value);
777          return true;
778       } else if (localName.equals("interceptors"))
779       {
780          StringTokenizer JavaDoc tokenizer = new StringTokenizer JavaDoc(value,",");
781          while (tokenizer.hasMoreTokens())
782          {
783             String JavaDoc interceptor = tokenizer.nextToken();
784             ejb.addInterceptor(interceptor);
785          }
786          return true;
787       }
788
789       return false;
790    }
791    
792    /**
793     * Called when a child element with simple content is read for DD.
794     */

795    public void setValue(MessageDrivenBean ejb,
796          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
797          String JavaDoc value)
798    {
799
800       if (!isEjbParentName(ejb, localName, value))
801       {
802          if (localName.equals("acknowledge-mode"))
803          {
804             ejb.setAcknowledgeMode(value);
805          } else if (localName.equals("transaction-type"))
806          {
807             ejb.setTransactionType(value);
808          }
809       }
810    }
811    
812    /**
813     * Called when a child element with simple content is read for DD.
814     */

815    public void setValue(MessageDrivenDestination destination,
816          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
817          String JavaDoc value)
818    {
819       if (localName.equals("destination-type"))
820       {
821          destination.setDestinationType(value);
822       } else if (localName.equals("subscription-durability"))
823       {
824          destination.setSubscriptionDurability(value);
825       }
826    }
827
828    /**
829     * Called when a child element with simple content is read for DD.
830     */

831    public void setValue(SessionEnterpriseBean ejb,
832          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
833          String JavaDoc value)
834    {
835
836       if (!isEjbParentName(ejb, localName, value))
837       {
838          if (localName.equals("session-type"))
839          {
840             ejb.setSessionType(value);
841          } else if (localName.equals("transaction-type"))
842          {
843             ejb.setTransactionType(value);
844          }
845       }
846    }
847
848    /**
849     * Called when a child element with simple content is read for DD.
850     */

851    public void setValue(EntityEnterpriseBean ejb,
852          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
853          String JavaDoc value)
854    {
855       if (!isEjbParentName(ejb, localName, value))
856       {
857          if (localName.equals("persistence-type"))
858          {
859             ejb.setPersistenceType(value);
860          }
861       }
862    }
863
864    /**
865     * Called when a child element with simple content is read for DD.
866     */

867    public void setValue(SecurityIdentity si, UnmarshallingContext navigator,
868          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
869    {
870       if (localName.equals("use-caller-identity"))
871       {
872          si.setUseCallerIdentity(true);
873       } else if (localName.equals("role-name"))
874       {
875          si.setRunAs(value);
876       }
877    }
878
879    /**
880     * Called when a child element with simple content is read for DD.
881     */

882    public void setValue(EjbLocalRef ref, UnmarshallingContext navigator,
883          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
884    {
885       if (localName.equals("ejb-ref-name"))
886       {
887          ref.setEjbRefName(value);
888       } else if (localName.equals("ejb-ref-type"))
889       {
890          ref.setEjbRefType(value);
891       } else if (localName.equals("local-home"))
892       {
893          ref.setLocalHome(value);
894       } else if (localName.equals("local"))
895       {
896          ref.setLocal(value);
897       } else if (localName.equals("ejb-link"))
898       {
899          ref.setEjbLink(value);
900       } else if (localName.equals("injection-target"))
901       {
902          ref.setInjectionTarget(value);
903       }
904    }
905
906    /**
907     * Called when a child element with simple content is read for DD.
908     */

909    public void setValue(EjbRef ref, UnmarshallingContext navigator,
910          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
911    {
912       if (localName.equals("ejb-ref-name"))
913       {
914          ref.setEjbRefName(value);
915       } else if (localName.equals("ejb-ref-type"))
916       {
917          ref.setEjbRefType(value);
918       } else if (localName.equals("local-home"))
919       {
920          ref.setLocalHome(value);
921       } else if (localName.equals("local"))
922       {
923          ref.setLocal(value);
924       } else if (localName.equals("remote"))
925       {
926          ref.setRemote(value);
927       } else if (localName.equals("ejb-link"))
928       {
929          ref.setEjbLink(value);
930       } else if (localName.equals("injection-target"))
931       {
932          ref.setInjectionTarget(value);
933       }
934    }
935    
936    /**
937     * Called when a child element with simple content is read for DD.
938     */

939    public void setValue(MessageDestinationRef ref, UnmarshallingContext navigator,
940          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
941    {
942       if (localName.equals("description"))
943       {
944          ref.setDescription(value);
945       } else if (localName.equals("message-destination-ref-name"))
946       {
947          ref.setMessageDestinationRefName(value);
948       } else if (localName.equals("message-destination-type"))
949       {
950          ref.setMessageDestinationType(value);
951       } else if (localName.equals("message-destination-usage"))
952       {
953          ref.setMessageDestinationUsage(value);
954       } else if (localName.equals("message-destination-link"))
955       {
956          ref.setMessageDestinationLink(value);
957       } else if (localName.equals("injection-target"))
958       {
959          ref.setInjectionTarget(value);
960       }
961    }
962    
963    /**
964     * Called when a child element with simple content is read for DD.
965     */

966    public void setValue(EnvEntry entry, UnmarshallingContext navigator,
967          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
968    {
969       if (localName.equals("description"))
970       {
971          entry.setDescription(value);
972       } else if (localName.equals("env-entry-name"))
973       {
974          entry.setEnvEntryName(value);
975       } else if (localName.equals("env-entry-type"))
976       {
977          entry.setEnvEntryType(value);
978       } else if (localName.equals("env-entry-value"))
979       {
980          entry.setEnvEntryValue(value);
981       } else if (localName.equals("injection-target"))
982       {
983          entry.setInjectionTarget(value);
984       }
985    }
986
987    /**
988     * Called when a child element with simple content is read for DD.
989     */

990    public void setValue(ResourceRef ref, UnmarshallingContext navigator,
991          String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
992    {
993       if (localName.equals("res-ref-name"))
994       {
995          ref.setResRefName(value);
996       } else if (localName.equals("res-type"))
997       {
998          ref.setResType(value);
999       } else if (localName.equals("res-auth"))
1000      {
1001         ref.setResAuth(value);
1002      } else if (localName.equals("res-sharing-scope"))
1003      {
1004         ref.setResSharingScope(value);
1005      } else if (localName.equals("injection-target"))
1006      {
1007         ref.setInjectionTarget(value);
1008      }
1009   }
1010
1011   /**
1012    * Called when a child element with simple content is read for DD.
1013    */

1014   public void setValue(EjbRelation relation, UnmarshallingContext navigator,
1015         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1016   {
1017      if (localName.equals("ejb-relation-name"))
1018      {
1019         relation.setEjbRelationName(value);
1020      }
1021   }
1022
1023   /**
1024    * Called when a child element with simple content is read for DD.
1025    */

1026   public void setValue(EjbRelationshipRole role,
1027         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1028         String JavaDoc value)
1029   {
1030      if (localName.equals("ejb-relationship-role-name"))
1031      {
1032         role.setEjbRelationshipRoleName(value);
1033      } else if (localName.equals("multiplicity"))
1034      {
1035         role.setMultiplicity(value);
1036      }
1037   }
1038
1039   /**
1040    * Called when a child element with simple content is read for DD.
1041    */

1042   public void setValue(RelationshipRoleSource source,
1043         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1044         String JavaDoc value)
1045   {
1046      if (localName.equals("ejb-name"))
1047      {
1048         source.setEjbName(value);
1049      }
1050   }
1051
1052   /**
1053    * Called when a child element with simple content is read for DD.
1054    */

1055   public void setValue(CmrField field, UnmarshallingContext navigator,
1056         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1057   {
1058      if (localName.equals("cmr-field-name"))
1059      {
1060         field.setCmrFieldName(value);
1061      } else if (localName.equals("cmr-field-type"))
1062      {
1063         field.setCmrFieldType(value);
1064      }
1065   }
1066
1067   /**
1068    * Called when a child element with simple content is read for DD.
1069    */

1070   public void setValue(SecurityRole role, UnmarshallingContext navigator,
1071         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1072   {
1073      if (localName.equals("role-name"))
1074      {
1075         role.setRoleName(value);
1076      }
1077   }
1078
1079   /**
1080    * Called when a child element with simple content is read for DD.
1081    */

1082   public void setValue(MethodPermission permission,
1083         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1084         String JavaDoc value)
1085   {
1086      if (localName.equals("role-name"))
1087      {
1088         permission.addRoleName(value);
1089      } else if (localName.equals("unchecked"))
1090      {
1091         permission.setUnchecked(true);
1092      }
1093   }
1094
1095   /**
1096    * Called when a child element with simple content is read for DD.
1097    */

1098   public void setValue(ContainerTransaction transaction,
1099         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1100         String JavaDoc value)
1101   {
1102      if (localName.equals("trans-attribute"))
1103      {
1104         transaction.setTransAttribute(value);
1105      }
1106   }
1107
1108   /**
1109    * Called when a child element with simple content is read for DD.
1110    */

1111   public void setValue(Method method, UnmarshallingContext navigator,
1112         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1113   {
1114      if (localName.equals("ejb-name"))
1115      {
1116         method.setEjbName(value);
1117      } else if (localName.equals("method-name"))
1118      {
1119         method.setMethodName(value);
1120      } else if (localName.equals("method-param"))
1121      {
1122         method.addMethodParam(value);
1123      }
1124   }
1125   
1126   /**
1127    * Called when a child element with simple content is read for DD.
1128    */

1129   public void setValue(Inject inject, UnmarshallingContext navigator,
1130         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1131   {
1132      if (localName.equals("jndi-name"))
1133      {
1134         inject.setJndiName(value);
1135      }
1136   }
1137   
1138   /**
1139    * Called when a child element with simple content is read for DD.
1140    */

1141   public void setValue(Callback callback, UnmarshallingContext navigator,
1142         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1143   {
1144      if (localName.equals("annotation"))
1145      {
1146         callback.setAnnotation(value);
1147      }
1148   }
1149}
1150
Popular Tags