KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.ejb3.metamodel;
23
24 import java.io.IOException JavaDoc;
25 import java.net.URL JavaDoc;
26
27 import javax.management.ObjectName JavaDoc;
28 import javax.persistence.PersistenceContextType;
29
30 import org.jboss.ejb3.KernelAbstraction;
31 import org.jboss.ejb3.KernelAbstractionFactory;
32 import org.jboss.logging.Logger;
33 import org.jboss.util.xml.JBossEntityResolver;
34 import org.jboss.xb.binding.JBossXBException;
35 import org.jboss.xb.binding.ObjectModelFactory;
36 import org.jboss.xb.binding.Unmarshaller;
37 import org.jboss.xb.binding.UnmarshallerFactory;
38 import org.jboss.xb.binding.UnmarshallingContext;
39 import org.xml.sax.Attributes JavaDoc;
40
41 import org.jboss.metamodel.descriptor.DDObjectFactory;
42 import org.jboss.metamodel.descriptor.EjbLocalRef;
43 import org.jboss.metamodel.descriptor.EjbRef;
44 import org.jboss.metamodel.descriptor.EnvEntry;
45 import org.jboss.metamodel.descriptor.MessageDestinationRef;
46 import org.jboss.metamodel.descriptor.PersistenceUnitRef;
47 import org.jboss.metamodel.descriptor.NameValuePair;
48 import org.jboss.metamodel.descriptor.ResourceEnvRef;
49 import org.jboss.metamodel.descriptor.ResourceRef;
50 import org.jboss.metamodel.descriptor.RunAs;
51 import org.jboss.metamodel.descriptor.ServiceRef;
52 import org.jboss.metamodel.descriptor.SecurityRole;
53 import org.jboss.metamodel.descriptor.PersistenceContextRef;
54
55 /**
56  * org.jboss.xb.binding.ObjectModelFactory implementation that accepts data
57  * chuncks from unmarshaller and assembles them into an EjbJarDD instance.
58  *
59  * @author <a HREF="mailto:bdecoste@jboss.com">William DeCoste</a>
60  * @version <tt>$Revision: 58121 $</tt>
61  */

62 public class EjbJarDDObjectFactory extends DDObjectFactory
63 {
64
65    private static final Logger log = Logger
66            .getLogger(EjbJarDDObjectFactory.class);
67
68    public static EjbJarDD parse(URL JavaDoc ddResource)
69       throws JBossXBException, IOException JavaDoc
70    {
71       ObjectModelFactory factory = null;
72       Unmarshaller unmarshaller = null;
73       EjbJarDD dd = null;
74
75       if (ddResource != null)
76       {
77          log.debug("found ejb-jar.xml " + ddResource);
78
79          factory = new EjbJarDDObjectFactory();
80          UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory
81                .newInstance();
82          unmarshallerFactory.setFeature(Unmarshaller.SCHEMA_VALIDATION, true);
83          unmarshaller = unmarshallerFactory.newUnmarshaller();
84          JBossEntityResolver entityResolver = new JBossEntityResolver();
85          unmarshaller.setEntityResolver(entityResolver);
86
87          dd = (EjbJarDD) unmarshaller.unmarshal(ddResource.openStream(),
88                factory, null);
89       }
90
91       return dd;
92    }
93
94    public Object JavaDoc newRoot(Object JavaDoc root, UnmarshallingContext navigator,
95                          String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
96    {
97
98       final EjbJarDD dd;
99       if (root == null)
100       {
101          root = dd = new EjbJarDD();
102       }
103       else
104       {
105          dd = (EjbJarDD) root;
106       }
107
108       if (attrs.getLength() > 0)
109       {
110          for (int i = 0; i < attrs.getLength(); ++i)
111          {
112             if (attrs.getLocalName(i).equals("version"))
113             {
114                dd.setVersion(attrs.getValue(i));
115             }
116          }
117       }
118
119       return root;
120    }
121
122    public Object JavaDoc completeRoot(Object JavaDoc root, UnmarshallingContext ctx,
123                               String JavaDoc uri, String JavaDoc name)
124    {
125       return root;
126    }
127
128    // Methods discovered by introspection
129

130    /**
131     * Called when parsing of a new element started.
132     */

133    public Object JavaDoc newChild(EjbJarDD dd, UnmarshallingContext navigator,
134                           String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
135    {
136       Object JavaDoc child = null;
137
138       if (localName.equals("enterprise-beans"))
139       {
140          child = new EnterpriseBeans();
141       }
142       if (localName.equals("interceptors"))
143       {
144          child = new Interceptors();
145       }
146       else if (localName.equals("relationships"))
147       {
148          child = new Relationships();
149       }
150       else if (localName.equals("assembly-descriptor"))
151       {
152          child = new AssemblyDescriptor();
153       }
154
155       return child;
156    }
157
158    /**
159     * Called when parsing of a new element started.
160     */

161    public Object JavaDoc newChild(EnterpriseBeans ejbs, UnmarshallingContext navigator,
162                           String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
163    {
164       Object JavaDoc child = null;
165
166       if (localName.equals("session"))
167       {
168          child = new SessionEnterpriseBean();
169       }
170       else if (localName.equals("entity"))
171       {
172          child = new EntityEnterpriseBean();
173       }
174       else if (localName.equals("message-driven"))
175       {
176          child = new MessageDrivenBean();
177       }
178
179       return child;
180    }
181
182    /**
183     * Called when parsing of a new element started.
184     */

185    private Object JavaDoc newEjbChild(EnterpriseBean parent, String JavaDoc localName)
186    {
187       Object JavaDoc child = null;
188
189       if ((child = super.newEnvRefGroupChild(localName)) != null)
190          return child;
191       return child;
192    }
193
194
195    private Object JavaDoc newEjbHasInterceptorsChild(EnterpriseBean parent, String JavaDoc localName)
196    {
197       Object JavaDoc child = null;
198
199       if (localName.equals("around-invoke"))
200       {
201          child = new Method();
202       }
203       else if (localName.equals("post-construct"))
204       {
205          child = new Method();
206       }
207       else if (localName.equals("pre-destroy"))
208       {
209          child = new Method();
210       }
211       else if (localName.equals("post-activate"))
212       {
213          child = new Method();
214       }
215       else if (localName.equals("pre-passivate"))
216       {
217          child = new Method();
218       }
219       return child;
220    }
221
222    public Object JavaDoc newChild(MessageDrivenBean parent,
223                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
224                           Attributes JavaDoc attrs)
225    {
226       Object JavaDoc child = newEjbChild(parent, localName);
227       if (child != null) return child;
228
229       child = newEjbHasInterceptorsChild(parent, localName);
230       if (child != null) return child;
231
232       if (localName.equals("message-driven-destination"))
233       {
234          child = new MessageDrivenDestination();
235       }
236       else if (localName.equals("activation-config"))
237       {
238          child = new ActivationConfig();
239       }
240
241       return child;
242    }
243
244    public Object JavaDoc newChild(ActivationConfig parent,
245                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
246                           Attributes JavaDoc attrs)
247    {
248       Object JavaDoc child = null;
249
250      if (localName.equals("activation-config-property"))
251      {
252          child = new NameValuePair();
253      }
254
255       return child;
256    }
257
258    /**
259     * Called when parsing of a new element started.
260     */

261    public Object JavaDoc newChild(SessionEnterpriseBean parent,
262                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
263                           Attributes JavaDoc attrs)
264    {
265       Object JavaDoc child = newEjbChild(parent, localName);
266       if (child != null) return child;
267
268       child = newEjbHasInterceptorsChild(parent, localName);
269       if (child != null) return child;
270
271       if (localName.equals("security-identity"))
272       {
273          child = new SecurityIdentity();
274       }
275       else if (localName.equals("remove-method"))
276       {
277          RemoveMethod method = new RemoveMethod();
278          parent.addRemoveMethod(method);
279          child = method;
280       }
281       else if (localName.equals("init-method"))
282       {
283          InitMethod method = new InitMethod();
284          parent.addInitMethod(method);
285          child = method;
286       }
287
288       return child;
289    }
290
291    /**
292     * Called when parsing of a new element started.
293     */

294    public Object JavaDoc newChild(EntityEnterpriseBean parent,
295                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
296                           Attributes JavaDoc attrs)
297    {
298       Object JavaDoc child = null;
299
300       child = newEjbChild(parent, localName);
301       if (child == null)
302       {
303          if (localName.equals("cmp-field"))
304          {
305             child = new CmpField();
306          }
307          else if (localName.equals("query"))
308          {
309             child = new Query();
310          }
311       }
312
313       return child;
314    }
315
316    /**
317     * Called when parsing of a new element started.
318     */

319    public Object JavaDoc newChild(SecurityIdentity parent,
320                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
321                           Attributes JavaDoc attrs)
322    {
323       Object JavaDoc child = null;
324
325       if (localName.equals("run-as"))
326       {
327          child = new RunAs();
328       }
329       else if (localName.equals("use-caller-identity"))
330       {
331          parent.setUseCallerIdentity(true);
332       }
333
334       return child;
335    }
336
337    /**
338     * Called when parsing of a new element started.
339     */

340    public Object JavaDoc newChild(RemoveMethod parent,
341                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
342                           Attributes JavaDoc attrs)
343    {
344       Object JavaDoc child = null;
345
346       if (localName.equals("bean-method"))
347       {
348          parent.setBeanMethod(new Method());
349          child = parent.getBeanMethod();
350       }
351
352       return child;
353    }
354
355    /**
356     * Called when parsing of a new element started.
357     */

358    public Object JavaDoc newChild(InitMethod parent,
359                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
360                           Attributes JavaDoc attrs)
361    {
362       Object JavaDoc child = null;
363
364       if (localName.equals("bean-method"))
365       {
366          parent.setBeanMethod(new Method());
367          child = parent.getBeanMethod();
368       }
369
370       return child;
371    }
372
373    /**
374     * Called when a child element with simple content is read for DD.
375     */

376    public void setValue(RemoveMethod dd, UnmarshallingContext navigator,
377                         String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
378    {
379       if (localName.equals("retain-if-exception"))
380       {
381          dd.setRetainIfException(Boolean.parseBoolean(getValue(localName, value)));
382       }
383    }
384
385    /**
386     * Called when parsing of a new element started.
387     */

388    public Object JavaDoc newChild(Relationships relationships,
389                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
390                           Attributes JavaDoc attrs)
391    {
392       Object JavaDoc child = null;
393
394       if (localName.equals("ejb-relation"))
395       {
396          child = new EjbRelation();
397       }
398
399       return child;
400    }
401
402    /**
403     * Called when parsing of a new element started.
404     */

405    public Object JavaDoc newChild(EjbRelation relation, UnmarshallingContext navigator,
406                           String JavaDoc namespaceURI, String JavaDoc localName, Attributes JavaDoc attrs)
407    {
408       Object JavaDoc child = null;
409
410       if (localName.equals("ejb-relationship-role"))
411       {
412          child = new EjbRelationshipRole();
413       }
414
415       return child;
416    }
417
418    /**
419     * Called when parsing of a new element started.
420     */

421    public Object JavaDoc newChild(EjbRelationshipRole parent,
422                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
423                           Attributes JavaDoc attrs)
424    {
425       Object JavaDoc child = null;
426
427       if (localName.equals("cascade-delete"))
428       {
429          parent.setCascadeDelete(true);
430       }
431       else if (localName.equals("relationship-role-source"))
432       {
433          child = new RelationshipRoleSource();
434       }
435       else if (localName.equals("cmr-field"))
436       {
437          child = new CmrField();
438       }
439
440       return child;
441    }
442
443    public Object JavaDoc newChild(Interceptors interceptors,
444                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
445                           Attributes JavaDoc attrs)
446    {
447       Object JavaDoc child = null;
448
449       if (localName.equals("interceptor"))
450       {
451          return new Interceptor();
452       }
453
454       return child;
455    }
456
457    public Object JavaDoc newChild(Interceptor interceptor,
458                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
459                           Attributes JavaDoc attrs)
460    {
461       Object JavaDoc child = null;
462
463       if ((child = this.newEnvRefGroupChild(localName)) != null)
464          return child;
465
466       if (localName.equals("around-invoke"))
467       {
468          return new Method();
469       }
470       else if (localName.equals("post-construct"))
471       {
472          return new Method();
473       }
474       else if (localName.equals("pre-destroy"))
475       {
476          return new Method();
477       }
478       else if (localName.equals("post-activate"))
479       {
480          return new Method();
481       }
482       else if (localName.equals("pre-passivate"))
483       {
484          return new Method();
485       }
486
487       return child;
488    }
489
490    /**
491     * Called when parsing of a new element started.
492     */

493    public Object JavaDoc newChild(AssemblyDescriptor relationships,
494                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
495                           Attributes JavaDoc attrs)
496    {
497       Object JavaDoc child = null;
498
499       if (localName.equals("security-role"))
500       {
501          child = new SecurityRole();
502       }
503       else if (localName.equals("method-permission"))
504       {
505          child = new MethodPermission();
506       }
507       if (localName.equals("container-transaction"))
508       {
509          child = new ContainerTransaction();
510       }
511       else if (localName.equals("inject"))
512       {
513          child = new Inject();
514       }
515       else if (localName.equals("exclude-list"))
516       {
517          child = new ExcludeList();
518       }
519       else if (localName.equals("application-exception"))
520       {
521          child = new ApplicationException();
522       }
523       else if (localName.equals("interceptor-binding"))
524       {
525          child = new InterceptorBinding();
526       }
527
528       return child;
529    }
530
531    /**
532     * Called when parsing of a new element started.
533     */

534    public Object JavaDoc newChild(Inject inject,
535                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
536                           Attributes JavaDoc attrs)
537    {
538       Object JavaDoc child = null;
539
540       if (localName.equals("method"))
541       {
542          child = new Method();
543       }
544
545       return child;
546    }
547
548    /**
549     * Called when parsing of a new element started.
550     */

551    public Object JavaDoc newChild(MethodPermission permission,
552                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
553                           Attributes JavaDoc attrs)
554    {
555       Object JavaDoc child = null;
556
557       if (localName.equals("method"))
558       {
559          child = new Method();
560       }
561       else if (localName.equals("unchecked"))
562       {
563          permission.setUnchecked(true);
564       }
565
566       return child;
567    }
568
569    /**
570     * Called when parsing of a new element started.
571     */

572    public Object JavaDoc newChild(ExcludeList list,
573                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
574                           Attributes JavaDoc attrs)
575    {
576       Object JavaDoc child = null;
577
578       if (localName.equals("method"))
579       {
580          child = new Method();
581       }
582
583       return child;
584    }
585
586    /**
587     * Called when parsing of a new element started.
588     */

589    public Object JavaDoc newChild(InitList list,
590                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
591                           Attributes JavaDoc attrs)
592    {
593       Object JavaDoc child = null;
594
595       if (localName.equals("method"))
596       {
597          child = new Method();
598       }
599
600       return child;
601    }
602
603    /**
604     * Called when parsing of a new element started.
605     */

606    public Object JavaDoc newChild(ContainerTransaction transaction,
607                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
608                           Attributes JavaDoc attrs)
609    {
610       Object JavaDoc child = null;
611
612       if (localName.equals("method"))
613       {
614          child = new Method();
615       }
616
617       return child;
618    }
619
620    public Object JavaDoc newChild(Method method,
621                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
622                           Attributes JavaDoc attrs)
623    {
624       Object JavaDoc child = null;
625
626       if (localName.equals("method-params"))
627       {
628          method.setHasParameters();
629       }
630
631       return child;
632    }
633
634
635    public Object JavaDoc newChild(InterceptorBinding binding,
636                           UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
637                           Attributes JavaDoc attrs)
638    {
639       Object JavaDoc child = null;
640
641       if (localName.equals("interceptor-order"))
642       {
643          child = new InterceptorOrder();
644       }
645       else if (localName.equals("exclude-default-interceptors"))
646       {
647          child = new ExcludeDefaultInterceptors();
648       }
649       else if (localName.equals("exclude-class-interceptors"))
650       {
651          child = new ExcludeClassInterceptors();
652       }
653       else if (localName.equals("method-params"))
654       {
655          binding.setHasParameters();
656       }
657
658
659       return child;
660    }
661
662
663    /**
664     * Called when parsing character is complete.
665     */

666    public void addChild(MessageDrivenBean parent, ActivationConfig config,
667                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
668    {
669       parent.setActivationConfig(config);
670    }
671
672    /**
673     * Called when parsing character is complete.
674     */

675    public void addChild(MessageDrivenBean parent, EjbRef ref,
676                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
677    {
678       parent.addEjbRef(ref);
679    }
680
681    /**
682     * Called when parsing character is complete.
683     */

684    public void addChild(MessageDrivenBean parent, EjbLocalRef ref,
685                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
686    {
687       parent.addEjbLocalRef(ref);
688    }
689
690    /**
691     * Called when parsing character is complete.
692     */

693    public void addChild(MessageDrivenBean parent, EnvEntry entry,
694                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
695    {
696       parent.addEnvEntry(entry);
697    }
698
699    /**
700     * Called when parsing character is complete.
701     */

702    public void addChild(MessageDrivenBean parent, ResourceEnvRef envRef,
703                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
704    {
705       parent.addResourceEnvRef(envRef);
706    }
707
708    /**
709     * Called when parsing character is complete.
710     */

711    public void addChild(MessageDrivenBean parent, ResourceRef envRef,
712                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
713    {
714       parent.addResourceRef(envRef);
715    }
716
717    public void addChild(MessageDrivenBean parent, ServiceRef envRef,
718                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
719    {
720       parent.addServiceRef(envRef);
721    }
722    
723    public void addChild(MessageDrivenBean parent, MessageDestinationRef ref,
724          UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
725    {
726       parent.addMessageDestinationRef(ref);
727    }
728
729    public void addChild(ActivationConfig parent, NameValuePair property,
730                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
731    {
732       parent.addActivationConfigProperty(property);
733    }
734
735    public void addChild(EjbJarDD parent, EnterpriseBeans ejbs,
736                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
737    {
738       parent.setEnterpriseBeans(ejbs);
739    }
740
741    /**
742     * Called when parsing character is complete.
743     */

744    public void addChild(EnterpriseBeans parent, EnterpriseBean ejb,
745                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
746    {
747       parent.addEnterpriseBean(ejb);
748    }
749
750    public void addChild(SessionEnterpriseBean parent, SecurityIdentity si,
751                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
752    {
753       parent.setSecurityIdentity(si);
754    }
755
756    public void addChild(SecurityIdentity parent, RunAs runAs,
757                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
758    {
759       parent.setRunAs(runAs);
760    }
761
762    public void addChild(SessionEnterpriseBean parent, EjbLocalRef ref,
763                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
764    {
765       parent.addEjbLocalRef(ref);
766    }
767
768    public void addChild(SessionEnterpriseBean parent, EjbRef ref,
769                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
770    {
771       parent.addEjbRef(ref);
772    }
773
774    public void addChild(SessionEnterpriseBean parent, PersistenceContextRef ref,
775                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
776    {
777       parent.addPersistenceContextRef(ref);
778    }
779
780    /**
781     * Called when parsing character is complete.
782     */

783    public void addChild(SessionEnterpriseBean parent, PersistenceUnitRef ref,
784                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
785    {
786       parent.addPersistenceUnitRef(ref);
787    }
788
789    /**
790     * Called when parsing character is complete.
791     */

792    public void addChild(SessionEnterpriseBean parent, MessageDestinationRef ref,
793                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
794    {
795       parent.addMessageDestinationRef(ref);
796    }
797
798    /**
799     * Called when parsing character is complete.
800     */

801    public void addChild(SessionEnterpriseBean parent, EnvEntry entry,
802                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
803    {
804       parent.addEnvEntry(entry);
805    }
806
807    /**
808     * Called when parsing character is complete.
809     */

810    public void addChild(SessionEnterpriseBean parent, ResourceEnvRef envRef,
811                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
812    {
813       parent.addResourceEnvRef(envRef);
814    }
815
816    /**
817     * Called when parsing character is complete.
818     */

819    public void addChild(SessionEnterpriseBean parent, ResourceRef envRef,
820                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
821    {
822       parent.addResourceRef(envRef);
823    }
824
825    /**
826     * Called when parsing character is complete.
827     */

828    public void addChild(SessionEnterpriseBean parent, ServiceRef envRef,
829                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
830    {
831       parent.addServiceRef(envRef);
832    }
833
834    /**
835     * Called when parsing character is complete.
836     */

837    public void addChild(SessionEnterpriseBean parent, Method method,
838                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
839    {
840       if (localName.equals("around-invoke"))
841       {
842          parent.setAroundInvoke(method);
843       }
844       else if (localName.equals("post-construct"))
845       {
846          parent.setPostConstruct(method);
847       }
848       else if (localName.equals("pre-destroy"))
849       {
850          parent.setPreDestroy(method);
851       }
852       else if (localName.equals("post-activate"))
853       {
854          parent.setPostActivate(method);
855       }
856       else if (localName.equals("pre-passivate"))
857       {
858          parent.setPrePassivate(method);
859       }
860    }
861
862    /**
863     * Called when parsing character is complete.
864     */

865    public void addChild(EntityEnterpriseBean parent, CmpField field,
866                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
867    {
868       parent.addCmpField(field);
869    }
870
871    /**
872     * Called when parsing character is complete.
873     */

874    public void addChild(EntityEnterpriseBean parent, Query query,
875                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
876    {
877       parent.addQuery(query);
878    }
879
880    /**
881     * Called when parsing character is complete.
882     */

883    public void addChild(EjbJarDD parent, Relationships relationships,
884                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
885    {
886       parent.setRelationships(relationships);
887    }
888
889    /**
890     * Called when parsing character is complete.
891     */

892    public void addChild(Relationships parent, EjbRelation relation,
893                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
894    {
895       parent.addEjbRelation(relation);
896    }
897
898    /**
899     * Called when parsing character is complete.
900     */

901    public void addChild(EjbRelation parent, EjbRelationshipRole role,
902                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
903    {
904       parent.addEjbRelationshipRole(role);
905    }
906
907    /**
908     * Called when parsing character is complete.
909     */

910    public void addChild(EjbRelationshipRole parent,
911                         RelationshipRoleSource source, UnmarshallingContext navigator,
912                         String JavaDoc namespaceURI, String JavaDoc localName)
913    {
914       parent.setRelationshipRoleSource(source);
915    }
916
917    /**
918     * Called when parsing character is complete.
919     */

920    public void addChild(EjbRelationshipRole parent, CmrField field,
921                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
922    {
923       parent.setCmrField(field);
924    }
925
926    /**
927     * Called when parsing character is complete.
928     */

929    public void addChild(EjbJarDD parent, AssemblyDescriptor descriptor,
930                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
931    {
932       parent.setAssemblyDescriptor(descriptor);
933    }
934
935    /**
936     * Called when parsing character is complete.
937     */

938    public void addChild(AssemblyDescriptor parent, SecurityRole role,
939                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
940    {
941       parent.addSecurityRole(role);
942    }
943
944    /**
945     * Called when parsing character is complete.
946     */

947    public void addChild(AssemblyDescriptor parent, MethodPermission permission,
948                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
949    {
950       parent.addMethodPermission(permission);
951    }
952
953    /**
954     * Called when parsing character is complete.
955     */

956    public void addChild(AssemblyDescriptor parent, ExcludeList list,
957                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
958    {
959       parent.setExcludeList(list);
960    }
961
962    /**
963     * Called when parsing character is complete.
964     */

965    public void addChild(AssemblyDescriptor parent, ApplicationException exception,
966                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
967    {
968       parent.addApplicationException(exception);
969    }
970
971    /**
972     * Called when parsing character is complete.
973     */

974    public void addChild(AssemblyDescriptor parent, InitList list,
975                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
976    {
977       parent.setInitList(list);
978    }
979
980    /**
981     * Called when parsing character is complete.
982     */

983    public void addChild(AssemblyDescriptor parent, Inject inject,
984                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
985    {
986       parent.addInject(inject);
987    }
988
989    /**
990     * Called when parsing character is complete.
991     */

992    public void addChild(AssemblyDescriptor parent, InterceptorBinding binding,
993                         UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
994    {
995       parent.addInterceptorBinding(binding);
996    }
997
998    /**
999     * Called when parsing character is complete.
1000    */

1001   public void addChild(ExcludeList parent, Method method,
1002                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1003   {
1004      parent.addMethod(method);
1005   }
1006
1007   /**
1008    * Called when parsing character is complete.
1009    */

1010   public void addChild(InitList parent, Method method,
1011                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1012   {
1013      parent.addMethod(method);
1014   }
1015
1016   /**
1017    * Called when parsing character is complete.
1018    */

1019   public void addChild(MethodPermission parent, Method method,
1020                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1021   {
1022      parent.addMethod(method);
1023   }
1024
1025   /**
1026    * Called when parsing character is complete.
1027    */

1028   public void addChild(Inject parent, Method method,
1029                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1030   {
1031      parent.addMethod(method);
1032   }
1033
1034   public void addChild(EjbJarDD parent, Interceptors interceptors,
1035                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1036   {
1037      parent.setInterceptors(interceptors);
1038   }
1039
1040   public void addChild(Interceptors parent, Interceptor interceptor,
1041                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1042   {
1043      parent.addInterceptor(interceptor);
1044   }
1045
1046   /**
1047    * Called when parsing character is complete.
1048    */

1049   public void addChild(Interceptor parent, EjbLocalRef ref,
1050                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1051   {
1052      parent.addEjbLocalRef(ref);
1053   }
1054
1055   /**
1056    * Called when parsing character is complete.
1057    */

1058   public void addChild(Interceptor parent, EjbRef ref,
1059                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1060   {
1061      parent.addEjbRef(ref);
1062   }
1063
1064   /**
1065    * Called when parsing character is complete.
1066    */

1067   public void addChild(Interceptor parent, PersistenceContextRef ref,
1068                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1069   {
1070      parent.addPersistenceContextRef(ref);
1071   }
1072
1073   /**
1074    * Called when parsing character is complete.
1075    */

1076   public void addChild(Interceptor parent, PersistenceUnitRef ref,
1077                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1078   {
1079      parent.addPersistenceUnitRef(ref);
1080   }
1081
1082   /**
1083    * Called when parsing character is complete.
1084    */

1085   public void addChild(Interceptor parent, MessageDestinationRef ref,
1086                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1087   {
1088      parent.addMessageDestinationRef(ref);
1089   }
1090
1091   /**
1092    * Called when parsing character is complete.
1093    */

1094   public void addChild(Interceptor parent, EnvEntry entry,
1095                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1096   {
1097      parent.addEnvEntry(entry);
1098   }
1099
1100   /**
1101    * Called when parsing character is complete.
1102    */

1103   public void addChild(Interceptor parent, ResourceEnvRef ref,
1104                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1105   {
1106      parent.addResourceEnvRef(ref);
1107   }
1108
1109   /**
1110    * Called when parsing character is complete.
1111    */

1112   public void addChild(Interceptor parent, ResourceRef ref,
1113                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1114   {
1115      parent.addResourceRef(ref);
1116   }
1117
1118   /**
1119    * Called when parsing character is complete.
1120    */

1121   public void addChild(Interceptor parent, ServiceRef ref,
1122                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1123   {
1124      parent.addServiceRef(ref);
1125   }
1126
1127   public void addChild(Interceptor parent, Method method,
1128                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1129   {
1130      if (localName.equals("around-invoke"))
1131      {
1132         parent.setAroundInvoke(method);
1133      }
1134      else if (localName.equals("post-construct"))
1135      {
1136         parent.setPostConstruct(method);
1137      }
1138      else if (localName.equals("pre-destroy"))
1139      {
1140         parent.setPreDestroy(method);
1141      }
1142      else if (localName.equals("post-activate"))
1143      {
1144         parent.setPostActivate(method);
1145      }
1146      else if (localName.equals("pre-passivate"))
1147      {
1148         parent.setPrePassivate(method);
1149      }
1150   }
1151
1152   /**
1153    * Called when parsing character is complete.
1154    */

1155   public void addChild(InterceptorBinding parent,
1156                        InterceptorOrder order, UnmarshallingContext navigator,
1157                        String JavaDoc namespaceURI, String JavaDoc localName)
1158   {
1159      parent.setOrderedInterceptorClasses(order);
1160   }
1161
1162   /**
1163    * Called when parsing character is complete.
1164    */

1165   public void addChild(InterceptorBinding parent,
1166                        ExcludeDefaultInterceptors exclude, UnmarshallingContext navigator,
1167                        String JavaDoc namespaceURI, String JavaDoc localName)
1168   {
1169      parent.setExcludeDefaultInterceptors(true);
1170   }
1171
1172   /**
1173    * Called when parsing character is complete.
1174    */

1175   public void addChild(InterceptorBinding parent,
1176                        ExcludeClassInterceptors exclude, UnmarshallingContext navigator,
1177                        String JavaDoc namespaceURI, String JavaDoc localName)
1178   {
1179      parent.setExcludeClassInterceptors(true);
1180   }
1181
1182   /**
1183    * Called when parsing character is complete.
1184    */

1185   public void addChild(ContainerTransaction parent, Method method,
1186                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1187   {
1188      parent.setMethod(method);
1189   }
1190
1191   /**
1192    * Called when parsing character is complete.
1193    */

1194   public void addChild(MessageDrivenBean parent, MessageDrivenDestination destination,
1195                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1196   {
1197      parent.setMessageDrivenDestination(destination);
1198   }
1199
1200   /**
1201    * Called when parsing character is complete.
1202    */

1203   public void addChild(MessageDrivenBean parent, Method method,
1204                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName)
1205   {
1206      if (localName.equals("around-invoke"))
1207      {
1208         parent.setAroundInvoke(method);
1209      }
1210      else if (localName.equals("post-construct"))
1211      {
1212         parent.setPostConstruct(method);
1213      }
1214      else if (localName.equals("pre-destroy"))
1215      {
1216         parent.setPreDestroy(method);
1217      }
1218   }
1219
1220   /**
1221    * Called when parsing character is complete.
1222    */

1223   public void addChild(AssemblyDescriptor parent,
1224                        ContainerTransaction transaction, UnmarshallingContext navigator,
1225                        String JavaDoc namespaceURI, String JavaDoc localName)
1226   {
1227      parent.addContainerTransaction(transaction);
1228   }
1229
1230   /**
1231    * Called when a child element with simple content is read for DD.
1232    */

1233   public void setValue(EjbJarDD dd, UnmarshallingContext navigator,
1234                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1235   {
1236      if (localName.equals("display-name"))
1237      {
1238         dd.setDisplayName(getValue(localName, value));
1239      }
1240   }
1241
1242   /**
1243    * Called when a child element with simple content is read for DD.
1244    */

1245   public void setValue(NameValuePair property, UnmarshallingContext navigator,
1246                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1247   {
1248      if (localName.equals("activation-config-property-name"))
1249      {
1250         property.setName(getValue(localName, value));
1251      }
1252      else if (localName.equals("activation-config-property-value"))
1253      {
1254         property.setValue(getValue(localName, value));
1255      }
1256   }
1257
1258   /**
1259    * Called when a child element with simple content is read for DD.
1260    */

1261   private boolean isEjbParentName(EnterpriseBean ejb, String JavaDoc localName,
1262                                   String JavaDoc value)
1263   {
1264      if (localName.equals("ejb-name"))
1265      {
1266         ejb.setEjbName(getValue(localName, value));
1267         return true;
1268      }
1269      else if (localName.equals("home"))
1270      {
1271         ejb.setHome(getValue(localName, value));
1272         return true;
1273      }
1274      else if (localName.equals("remote"))
1275      {
1276         ejb.setRemote(getValue(localName, value));
1277         return true;
1278      }
1279      else if (localName.equals("local-home"))
1280      {
1281         ejb.setLocalHome(getValue(localName, value));
1282         return true;
1283      }
1284      else if (localName.equals("local"))
1285      {
1286         ejb.setLocal(getValue(localName, value));
1287         return true;
1288      }
1289      else if (localName.equals("ejb-class"))
1290      {
1291         ejb.setEjbClass(getValue(localName, value));
1292         return true;
1293      }
1294
1295      return false;
1296   }
1297
1298   /**
1299    * Called when a child element with simple content is read for DD.
1300    */

1301   public void setValue(MessageDrivenBean ejb,
1302                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1303                        String JavaDoc value)
1304   {
1305      if (!isEjbParentName(ejb, localName, value))
1306      {
1307         if (localName.equals("acknowledge-mode"))
1308         {
1309            ejb.setAcknowledgeMode(getValue(localName, value));
1310         }
1311         else if (localName.equals("transaction-type"))
1312         {
1313            ejb.setTransactionType(getValue(localName, value));
1314         }
1315         else if (localName.equals("messaging-type"))
1316         {
1317            ejb.setMessagingType(getValue(localName, value));
1318         }
1319         else if (localName.equals("message-destination-type"))
1320         {
1321            MessageDrivenDestination destination = ejb.getMessageDrivenDestination();
1322            if (destination == null)
1323            {
1324               destination = new MessageDrivenDestination();
1325               ejb.setMessageDrivenDestination(destination);
1326            }
1327
1328            destination.setDestinationType(getValue(localName, value));
1329         }
1330      }
1331   }
1332
1333   /**
1334    * Called when a child element with simple content is read for DD.
1335    */

1336   public void setValue(MessageDrivenDestination destination,
1337                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1338                        String JavaDoc value)
1339   {
1340      if (localName.equals("destination-type"))
1341      {
1342         destination.setDestinationType(getValue(localName, value));
1343      }
1344      else if (localName.equals("subscription-durability"))
1345      {
1346         destination.setSubscriptionDurability(getValue(localName, value));
1347      }
1348   }
1349
1350   /**
1351    * Called when a child element with simple content is read for DD.
1352    */

1353   public void setValue(SessionEnterpriseBean ejb,
1354                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1355                        String JavaDoc value)
1356   {
1357      if (!isEjbParentName(ejb, localName, value))
1358      {
1359         if (localName.equals("session-type"))
1360         {
1361            ejb.setSessionType(getValue(localName, value));
1362         }
1363         else if (localName.equals("transaction-type"))
1364         {
1365            ejb.setTransactionManagementType(getValue(localName, value));
1366         }
1367      }
1368   }
1369
1370   /**
1371    * Called when a child element with simple content is read for DD.
1372    */

1373   public void setValue(ApplicationException exception,
1374                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1375                        String JavaDoc value)
1376   {
1377      if (localName.equals("exception-class"))
1378      {
1379         exception.setExceptionClass(getValue(localName, value));
1380      }
1381      else if (localName.equals("rollback"))
1382      {
1383         exception.setRollback(Boolean.valueOf(getValue(localName, value)));
1384      }
1385   }
1386
1387   /**
1388    * Called when a child element with simple content is read for DD.
1389    */

1390   public void setValue(EntityEnterpriseBean ejb,
1391                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1392                        String JavaDoc value)
1393   {
1394      if (!isEjbParentName(ejb, localName, value))
1395      {
1396         if (localName.equals("persistence-type"))
1397         {
1398            ejb.setPersistenceType(getValue(localName, value));
1399         }
1400      }
1401   }
1402
1403   /**
1404    * Called when a child element with simple content is read for DD.
1405    */

1406   public void setValue(SecurityIdentity si, UnmarshallingContext navigator,
1407                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1408   {
1409      if (localName.equals("use-caller-identity"))
1410      {
1411         si.setUseCallerIdentity(true);
1412      }
1413   }
1414
1415   public void setValue(Interceptor interceptor, UnmarshallingContext navigator,
1416                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1417   {
1418      if (localName.equals("interceptor-class"))
1419      {
1420         interceptor.setInterceptorClass(getValue(localName, value));
1421      }
1422   }
1423
1424   /**
1425    * Called when a child element with simple content is read for DD.
1426    */

1427   public void setValue(EjbRelation relation, UnmarshallingContext navigator,
1428                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1429   {
1430      if (localName.equals("ejb-relation-name"))
1431      {
1432         relation.setEjbRelationName(getValue(localName, value));
1433      }
1434   }
1435
1436   /**
1437    * Called when a child element with simple content is read for DD.
1438    */

1439   public void setValue(EjbRelationshipRole role,
1440                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1441                        String JavaDoc value)
1442   {
1443      if (localName.equals("ejb-relationship-role-name"))
1444      {
1445         role.setEjbRelationshipRoleName(getValue(localName, value));
1446      }
1447      else if (localName.equals("multiplicity"))
1448      {
1449         role.setMultiplicity(getValue(localName, value));
1450      }
1451   }
1452
1453   /**
1454    * Called when a child element with simple content is read for DD.
1455    */

1456   public void setValue(RelationshipRoleSource source,
1457                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1458                        String JavaDoc value)
1459   {
1460      if (localName.equals("ejb-name"))
1461      {
1462         source.setEjbName(getValue(localName, value));
1463      }
1464   }
1465
1466   /**
1467    * Called when a child element with simple content is read for DD.
1468    */

1469   public void setValue(CmrField field, UnmarshallingContext navigator,
1470                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1471   {
1472      if (localName.equals("cmr-field-name"))
1473      {
1474         field.setCmrFieldName(getValue(localName, value));
1475      }
1476      else if (localName.equals("cmr-field-type"))
1477      {
1478         field.setCmrFieldType(getValue(localName, value));
1479      }
1480   }
1481
1482   /**
1483    * Called when a child element with simple content is read for DD.
1484    */

1485   public void setValue(SecurityRole role, UnmarshallingContext navigator,
1486                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1487   {
1488      if (localName.equals("role-name"))
1489      {
1490         role.setRoleName(getValue(localName, value));
1491      }
1492   }
1493
1494   /**
1495    * Called when a child element with simple content is read for DD.
1496    */

1497   public void setValue(MethodPermission permission,
1498                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1499                        String JavaDoc value)
1500   {
1501      if (localName.equals("role-name"))
1502      {
1503         permission.addRoleName(getValue(localName, value));
1504      }
1505      else if (localName.equals("unchecked"))
1506      {
1507         permission.setUnchecked(true);
1508      }
1509   }
1510
1511   /**
1512    * Called when a child element with simple content is read for DD.
1513    */

1514   public void setValue(ContainerTransaction transaction,
1515                        UnmarshallingContext navigator, String JavaDoc namespaceURI, String JavaDoc localName,
1516                        String JavaDoc value)
1517   {
1518      if (localName.equals("trans-attribute"))
1519      {
1520         transaction.setTransAttribute(getValue(localName, value));
1521      }
1522   }
1523
1524   /**
1525    * Called when a child element with simple content is read for DD.
1526    */

1527   public void setValue(Method method, UnmarshallingContext navigator,
1528                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1529   {
1530      if (localName.equals("ejb-name"))
1531      {
1532         method.setEjbName(getValue(localName, value));
1533      }
1534      else if (localName.equals("method-name"))
1535      {
1536         method.setMethodName(getValue(localName, value));
1537      }
1538      else if (localName.equals("method-param"))
1539      {
1540         method.addMethodParam(getValue(localName, value));
1541      }
1542      else if (localName.equals("lifecycle-callback-method"))
1543      {
1544         method.setMethodName(getValue(localName, value));
1545      }
1546   }
1547
1548   /**
1549    * Called when a child element with simple content is read for DD.
1550    */

1551   public void setValue(Inject inject, UnmarshallingContext navigator,
1552                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1553   {
1554      if (localName.equals("jndi-name"))
1555      {
1556         inject.setJndiName(getValue(localName, value));
1557      }
1558   }
1559
1560   public void setValue(InterceptorBinding binding, UnmarshallingContext navigator,
1561                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1562   {
1563      if (localName.equals("ejb-name"))
1564      {
1565         binding.setEjbName(getValue(localName, value));
1566      }
1567      else if (localName.equals("interceptor-class"))
1568      {
1569         binding.addInterceptorClass(getValue(localName, value));
1570      }
1571      else if (localName.equals("method-name"))
1572      {
1573         binding.setMethodName(getValue(localName, value));
1574      }
1575      else if (localName.equals("method-param"))
1576      {
1577         binding.addMethodParam(getValue(localName, value));
1578      }
1579      else if (localName.equals("exclude-default-interceptors"))
1580      {
1581         binding.setExcludeDefaultInterceptors(true);
1582      }
1583      else if (localName.equals("exclude-class-interceptors"))
1584      {
1585         binding.setExcludeClassInterceptors(true);
1586      }
1587   }
1588
1589   public void setValue(InterceptorOrder order, UnmarshallingContext navigator,
1590                        String JavaDoc namespaceURI, String JavaDoc localName, String JavaDoc value)
1591   {
1592      if (localName.equals("interceptor-class"))
1593      {
1594         order.addInterceptorClass(getValue(localName, value));
1595      }
1596   }
1597   
1598   protected String JavaDoc getValue(String JavaDoc name, String JavaDoc value)
1599   {
1600      if (value.startsWith("${") && value.endsWith("}"))
1601      {
1602         try
1603         {
1604            String JavaDoc propertyName = value.substring(2, value.length()-1);
1605            ObjectName JavaDoc propertyServiceON = new ObjectName JavaDoc("jboss:type=Service,name=SystemProperties");
1606            KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
1607            String JavaDoc propertyValue = (String JavaDoc)kernelAbstraction.invoke(propertyServiceON, "get", new Object JavaDoc[]{propertyName}, new String JavaDoc[]{"java.lang.String"});
1608            log.debug("Replaced ejb-jar.xml element " + name + " with value " + propertyValue);
1609            return propertyValue;
1610         }
1611         catch (Exception JavaDoc e)
1612         {
1613            log.warn("Unable to look up property service for ejb-jar.xml element " + name + " with value " + value + ". Caused by " + e.getClass() + " " + e.getMessage());
1614         }
1615      }
1616      
1617      return value;
1618   }
1619
1620}
1621
Popular Tags