KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > ConnectorDescriptor


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  package com.sun.enterprise.deployment;
24
25 import java.util.*;
26 import java.util.jar.*;
27 import java.io.*;
28 import java.util.zip.*;
29 import java.util.logging.Level JavaDoc;
30 import com.sun.enterprise.deployment.util.ConnectorVisitor;
31 import com.sun.enterprise.deployment.util.DescriptorVisitor;
32 import com.sun.enterprise.deployment.node.connector.ConnectorNode;
33 import com.sun.enterprise.deployment.xml.ConnectorTagNames;
34 import com.sun.enterprise.deployment.xml.ApplicationTagNames;
35 import com.sun.enterprise.deployment.runtime.connector.SunConnector;
36 import com.sun.enterprise.deployment.util.DOLUtils;
37 import javax.enterprise.deploy.shared.ModuleType JavaDoc;
38 /**
39  * Deployment Information for connector
40  *
41  * <!ELEMENT connector (display-name?, description?, icon?, vendor-name,
42  * spec-version, eis-type, version, license?, resourceadapter)>
43  *
44  * @author Tony Ng
45  * @author Qingqing Ouyang
46  */

47 public class ConnectorDescriptor extends BundleDescriptor {
48
49     private boolean isDirty = false;
50     
51     private String JavaDoc displayName = "";
52     private String JavaDoc connectorDescription = "";
53     private String JavaDoc largeIcon = "";
54     private String JavaDoc smallIcon = "";
55     private String JavaDoc vendorName = "";
56     private String JavaDoc eisType = "";
57     //private String version = "";
58
private String JavaDoc resourceAdapterVersion = "";
59     private LicenseDescriptor licenseDescriptor = null;
60
61     //connector1.0 old stuff, need clean up
62
private Set configProperties;
63     private Set authMechanisms;
64     private Set securityPermissions;
65     private String JavaDoc managedConnectionFactoryImpl = "";
66     private int transactionSupport = PoolManagerConstants.LOCAL_TRANSACTION;
67     private boolean reauthenticationSupport = false;
68     private String JavaDoc connectionInterface;
69     private String JavaDoc connectionClass;
70     private String JavaDoc connectionFactoryInterface;
71     private String JavaDoc connectionFactoryClass;
72       
73     //connector1.5 begin
74
private String JavaDoc resourceAdapterClass = "";
75     private EnvironmentProperty configProperty = null;
76     private OutboundResourceAdapter outboundRA = null;
77     private InboundResourceAdapter inboundRA = null;
78     private Set adminObjects;
79
80     //FIXME "inboundResourceAdapterClass" no longer valid
81
//Use "resourceAdapterClass" instead
82
private String JavaDoc inboundResourceAdapterClass = "";
83
84     //FIXME remove messagelisteners
85
private Set messageListeners;
86     //connector1.5 end
87

88     // following are all the get and set methods for the
89
// various variables listed above
90

91     public ConnectorDescriptor() {
92         this.configProperties = new OrderedSet();
93     this.authMechanisms = new OrderedSet();
94     this.securityPermissions = new OrderedSet();
95     this.adminObjects = new OrderedSet();
96
97         //FIXME. need to remove the following
98
this.messageListeners = new OrderedSet();
99     }
100
101
102     /**
103      * @return the default version of the deployment descriptor
104      * loaded by this descriptor
105      */

106     public String JavaDoc getDefaultSpecVersion() {
107         return ConnectorNode.SPEC_VERSION;
108     }
109
110     ////////////////////////////////////////////////////////////////////
111
// The following are access methods for connector1.0's
112
// resourceadapter element.
113
// We no longer support them.
114
////////////////////////////////////////////////////////////////////
115

116     //QQ. FIXME. After verifier stops using this interface,
117
//this REALLY needs to be removed. (for 1.0 cases only)
118

119     // The methods for connection and connection factories have now shifted
120
//to OutboundResourceAdapter to maintain backward compatibility
121
//Sheetal. These methods should be removed from here once we start
122
//using new DOL
123

124     /**
125      * @deprecated
126      */

127     public String JavaDoc getConnectionFactoryInterface() {
128         throw new UnsupportedOperationException JavaDoc();
129     }
130     
131     /**
132      * @deprecated
133      */

134     public void
135     setConnectionFactoryInterface(String JavaDoc connectionFactoryInterface) {
136         throw new UnsupportedOperationException JavaDoc();
137     }
138     
139     /**
140      * @deprecated
141      */

142     public String JavaDoc
143     getConnectionFactoryImpl() {
144         throw new UnsupportedOperationException JavaDoc();
145     }
146     
147     /**
148      * @deprecated
149      */

150     public void
151     setConnectionFactoryImpl(String JavaDoc connectionFactoryImpl) {
152         throw new UnsupportedOperationException JavaDoc();
153     }
154
155     /**
156      * @deprecated
157      */

158     public String JavaDoc
159     getConnectionInterface() {
160         throw new UnsupportedOperationException JavaDoc();
161     }
162     
163     /**
164      * @deprecated
165      */

166     public void
167     setConnectionInterface(String JavaDoc connectionInterface) {
168         throw new UnsupportedOperationException JavaDoc();
169     }
170
171     /**
172      * @deprecated
173      */

174     public String JavaDoc
175     getConnectionImpl() {
176         throw new UnsupportedOperationException JavaDoc();
177     }
178  
179     /**
180      * @deprecated
181      */

182     public void
183     setConnectionImpl(String JavaDoc connectionImpl) {
184         throw new UnsupportedOperationException JavaDoc();
185     }
186
187     /**
188      * @deprecated
189      */

190     public String JavaDoc getManagedConnectionFactoryImpl() {
191         throw new UnsupportedOperationException JavaDoc();
192     }
193
194     /**
195      * @deprecated
196      */

197     public void setManagedConnectionFactoryImpl(String JavaDoc managedConnectionFactoryImpl) {
198         throw new UnsupportedOperationException JavaDoc();
199     }
200
201     /**
202      * @deprecated
203      */

204     public boolean supportsReauthentication() {
205         throw new UnsupportedOperationException JavaDoc();
206     }
207
208     /**
209      * @deprecated
210      */

211     public String JavaDoc getReauthenticationSupport() {
212         throw new UnsupportedOperationException JavaDoc();
213     }
214  
215     /**
216      * @deprecated
217      */

218     public void setReauthenticationSupport(boolean reauthenticationSupport) {
219         throw new UnsupportedOperationException JavaDoc();
220     }
221
222     /**
223      * @deprecated
224      */

225     public void setReauthenticationSupport(String JavaDoc reauthSupport) {
226         throw new UnsupportedOperationException JavaDoc();
227     }
228
229     /**
230      * @deprecated
231      */

232     public String JavaDoc getTransSupport() {
233         throw new UnsupportedOperationException JavaDoc();
234     }
235
236     /**
237      * @deprecated
238      */

239     public int getTransactionSupport() {
240         throw new UnsupportedOperationException JavaDoc();
241     }
242     
243     /**
244      * @deprecated
245      */

246     public void setTransactionSupport(int transactionSupport) {
247         throw new UnsupportedOperationException JavaDoc();
248     }
249
250     /**
251      * @deprecated
252      */

253     public void setTransactionSupport(String JavaDoc support) {
254         throw new UnsupportedOperationException JavaDoc();
255     }
256
257     /**
258      * @deprecated
259      */

260     public Set
261     getAuthMechanisms() {
262         throw new UnsupportedOperationException JavaDoc();
263     }
264     
265     /**
266      * @return a set of service-ref from this bundle or null
267      * if none
268      */

269     public Set getServiceReferenceDescriptors() {
270         return new OrderedSet();
271     }
272
273     /**
274      *Set of SecurityPermission objects
275      */

276     public Set
277     getSecurityPermissions()
278     {
279         if (securityPermissions == null) {
280             securityPermissions = new OrderedSet();
281         }
282         return securityPermissions;
283     }
284
285     /**
286      * @deprecated
287      */

288     public boolean
289     addAuthMechanism(AuthMechanism mech)
290     {
291         throw new UnsupportedOperationException JavaDoc();
292     }
293     
294     /**
295      * @deprecated
296      */

297     public boolean
298     removeAuthMechanism(AuthMechanism mech)
299     {
300         throw new UnsupportedOperationException JavaDoc();
301     }
302
303     /**
304      * @deprecated
305      */

306     public boolean
307     addAuthMechanism(int mech)
308     {
309         throw new UnsupportedOperationException JavaDoc();
310     }
311     
312
313     /**
314      * @deprecated
315      */

316     public boolean
317     removeAuthMechanism(int mech)
318     {
319         throw new UnsupportedOperationException JavaDoc();
320     }
321
322     /**
323      * Add a SecurityPermission object to the set
324      */

325     public void
326     addSecurityPermission(SecurityPermission permission)
327     {
328     this.securityPermissions.add(permission);
329     this.setDirty();
330     this.changed();
331     }
332
333     /**
334      * Remove a SecurityPermission object to the set
335      */

336     public void
337     removeSecurityPermission(SecurityPermission permission)
338     {
339     this.securityPermissions.remove(permission);
340     this.setDirty();
341     this.changed();
342     }
343
344     ///////////////////////////////////////////////////////////////////////
345
// The following are specific to connector1.5 elements
346
// <!ELEMENT resourceadapter (resourceadapter-class, config-property?,
347
// outbound-resourceadapter?, inbound-resourceadapter?, adminobject*)>
348
///////////////////////////////////////////////////////////////////////
349

350     //connector1.5 begin
351

352     public String JavaDoc getResourceAdapterClass() {
353         return resourceAdapterClass;
354     }
355     
356     public void setResourceAdapterClass (String JavaDoc raClass) {
357         this.resourceAdapterClass = raClass;
358         this.setDirty();
359         this.changed();
360     }
361     
362     /** Set of EnvironmentProperty
363      */

364     public Set getConfigProperties() {
365         return configProperties;
366     }
367          
368     /** add a configProperty to the set
369      */

370     public void addConfigProperty(EnvironmentProperty configProperty) {
371     this.configProperties.add(configProperty);
372         this.setDirty();
373         this.changed();
374     }
375
376     /** remove a configProperty from the set
377      */

378     public void removeConfigProperty(EnvironmentProperty configProperty) {
379     this.configProperties.remove(configProperty);
380         this.setDirty();
381         this.changed();
382     }
383
384     public LicenseDescriptor getLicenseDescriptor() {
385         return licenseDescriptor;
386     }
387
388     public void setLicenseDescriptor (LicenseDescriptor licenseDescriptor) {
389         this.licenseDescriptor = licenseDescriptor;
390         this.setDirty();
391         this.changed();
392     }
393
394     public OutboundResourceAdapter getOutboundResourceAdapter() {
395         return this.outboundRA;
396     }
397     
398     public void
399     setOutboundResourceAdapter (OutboundResourceAdapter outboundRA) {
400         this.outboundRA = outboundRA;
401     }
402     
403     public InboundResourceAdapter getInboundResourceAdapter() {
404         return this.inboundRA;
405     }
406     
407     public void
408     setInboundResourceAdapter(InboundResourceAdapter inboundRA) {
409         this.inboundRA = inboundRA;
410     }
411
412     /**
413      *@return admin objects
414      */

415     public Set getAdminObjects() {
416         return this.adminObjects;
417     }
418
419     /**
420      * set admin object
421      */

422     public void addAdminObject(AdminObject admin) {
423         this.adminObjects.add(admin);
424         this.setDirty();
425         this.changed();
426     }
427
428     public void removeAdminObject(AdminObject admin) {
429         this.adminObjects.remove(admin);
430         this.setDirty();
431         this.changed();
432     }
433
434     public boolean hasAdminObjects() {
435         return adminObjects.size() > 0;
436     }
437  
438     /*
439     public boolean isConnector15() {
440         return (resourceAdapterClass != null
441                 && !"".equals(resourceAdapterClass));
442     }
443     */

444
445     //for the purpose of writing this optional node back to XML format.
446
//if this node is present then write it else donot.
447
/*
448     public void setOutBoundDefined(boolean value) {
449         throw new UnsupportedOperationException();
450     }
451     */

452
453     public boolean getOutBoundDefined() {
454     return outboundRA != null;
455     }
456
457     //for the purpose of writing this optional node back to XML format.
458
//if this node is present then write it else donot.
459
/*
460     public void setInBoundDefined(boolean value) {
461         throw new UnsupportedOperationException();
462     }
463     */

464
465     public boolean getInBoundDefined() {
466         return inboundRA != null;
467     }
468
469     /*
470     public String getInboundResourceAdapterClass() {
471         throw new UnsupportedOperationException();
472     }
473
474     public void setInboundResourceAdapterClass (String raClass) {
475         throw new UnsupportedOperationException();
476     }
477     */

478
479     //connector1.5 end
480

481
482     /////////////////////////////////////////////////////////////
483
// The following are the accessor methods for elements that
484
// are common to both connector1.0 and connector1.5
485
/////////////////////////////////////////////////////////////
486

487     /** override 'setDescription' to set 'dirty' flag
488     */

489     public void setDescription(String JavaDoc description) {
490     this.setDirty();
491     super.setDescription(description);
492     }
493
494     /** get the connector description
495     */

496     public String JavaDoc getConnectorDescription() {
497         return connectorDescription;
498     }
499  
500     /** set the connector description
501     */

502     public void setConnectorDescription(String JavaDoc description) {
503         this.connectorDescription = description;
504     this.setDirty();
505         this.changed();
506     }
507
508     /** override 'setLargeIconUri' to set 'dirty' flag
509     */

510     public void setLargeIconUri(String JavaDoc largeIconUri) {
511     this.setDirty();
512     super.setLargeIconUri(largeIconUri);
513     }
514
515     /** override 'setSmallIconUri' to set 'dirty' flag
516     */

517     public void setSmallIconUri(String JavaDoc smallIconUri) {
518     this.setDirty();
519     super.setSmallIconUri(smallIconUri);
520     }
521
522     /** get value for vendorName
523     */

524     public String JavaDoc getVendorName() {
525         return vendorName;
526     }
527  
528     /** set value for vendorName
529     */

530     public void setVendorName(String JavaDoc vendorName) {
531         this.vendorName = vendorName;
532     this.setDirty();
533         this.changed();
534     }
535
536     /** set value for specVersion
537     */

538     public void setSpecVersion(String JavaDoc specVersion) {
539         super.setSpecVersion(specVersion);
540     this.setDirty();
541         this.changed();
542
543     }
544
545     /** get eisType
546     */

547     public String JavaDoc getEisType() {
548         return eisType;
549     }
550  
551    
552     /** set eisType
553     */

554     public void setEisType(String JavaDoc eisType) {
555         this.eisType = eisType;
556     this.setDirty();
557         this.changed();
558     }
559
560     /** get value for version
561     */

562     public String JavaDoc getVersion() {
563         //return version;
564
throw new UnsupportedOperationException JavaDoc();
565     }
566
567     /** set value for version
568     */

569     public void setVersion(String JavaDoc version) {
570         /*this.version = version;
571     this.setDirty();
572         this.changed();*/

573         throw new UnsupportedOperationException JavaDoc();
574     }
575
576     /** get value for resourceadapter version (1.5 schema
577     */

578     public String JavaDoc getResourceAdapterVersion() {
579         return resourceAdapterVersion;
580     }
581
582     /** set value for resourceadater version (1.5 schema)
583     */

584     public void setResourceAdapterVersion(String JavaDoc resourceAdapterVersion) {
585         this.resourceAdapterVersion = resourceAdapterVersion;
586     this.setDirty();
587         this.changed();
588     }
589
590     ////////////////////////////////////////////////////////
591
// Other MISC methods
592
////////////////////////////////////////////////////////
593

594     /** return name used for deployment
595     */

596     public String JavaDoc getDeployName() {
597     return getModuleDescriptor().getArchiveUri();
598     }
599             
600     /**
601      * A flag to indicate that my data has changed since the last save.
602      */

603     public boolean isDirty() {
604     return this.isDirty;
605     }
606
607     private void setDirty() {
608         this.isDirty = true;
609     }
610     
611     void doneOpening() {
612     this.isDirty = false;
613     this.changed();
614     }
615
616     void doneSaving() {
617     this.isDirty = false;
618     this.changed();
619     }
620
621     /** override 'setName' to set 'dirty' flag
622     */

623     public void setName(String JavaDoc name) {
624     if (!this.getName().equals(name)) {
625         this.setDirty();
626         super.setName(name);
627     }
628     }
629     
630     /**
631      * visit the descriptor and all sub descriptors with a DOL visitor implementation
632      *
633      * @param a visitor to traverse the descriptors
634      */

635     public void visit(DescriptorVisitor aVisitor) {
636         if (aVisitor instanceof ConnectorVisitor) {
637             visit((ConnectorVisitor) aVisitor);
638         } else {
639             super.visit(aVisitor);
640         }
641     }
642
643     /**
644      * visit the descriptor and all sub descriptors with a
645      * DOL visitor implementation
646      * @param a visitor to traverse the descriptors
647      */

648     public void visit(ConnectorVisitor aVisitor) {
649         aVisitor.accept(this);
650     }
651
652     /*
653      * Prints entry information.
654      */

655     private static void printEntry(ZipEntry e) throws IOException {
656         DOLUtils.getDefaultLogger().log(Level.FINE, e.getName());
657     }
658     
659     /*
660      * @param type The full qualified name for connection factory interface
661      */

662     public ConnectionDefDescriptor
663     getConnectionDefinitionByCFType (String JavaDoc type)
664     {
665         return getConnectionDefinitionByCFType(type, true);
666     }
667
668     /*
669      * @param type The full qualified name for connection factory interface
670      * @param useDefault This param is to support the backward compatibility
671      * of connector 1.0 resource adapter where there is
672      * only one connection factory type. If type is null
673      * and useDefault is true, the only CF will be returned.
674      */

675     public ConnectionDefDescriptor
676     getConnectionDefinitionByCFType (String JavaDoc type, boolean useDefault)
677     {
678         Iterator it = this.outboundRA.getConnectionDefs().iterator();
679         while (it.hasNext())
680         {
681             ConnectionDefDescriptor desc = (ConnectionDefDescriptor) it.next();
682             
683             if (type == null)
684             {
685                 if (useDefault
686                         && this.outboundRA.getConnectionDefs().size() == 1)
687                     return desc;
688                 else
689                     return null;
690             }
691                     
692             if (desc.getConnectionFactoryIntf().equals(type))
693                 return desc;
694         }
695         return null;
696     }
697
698     public int getNumOfSupportedCFs ()
699     {
700         return outboundRA.getConnectionDefs().size();
701     }
702
703     public AdminObject getAdminObjectByType(String JavaDoc type)
704     {
705         Iterator i = getAdminObjects().iterator();
706         while (i.hasNext())
707         {
708             AdminObject ao = (AdminObject) i.next();
709             if (type.equals(ao.getAdminObjectInterface()))
710                 return ao;
711         }
712         
713         return null;
714     }
715
716         
717     /**
718      * A formatted string representing my state.
719      */

720     public void print(StringBuffer JavaDoc toStringBuffer)
721     {
722         StringBuffer JavaDoc buf = toStringBuffer;
723         super.print(buf);
724         
725     buf.append("\n displayName : " + super.getName());
726     buf.append("\n connector_description : " + connectorDescription);
727     buf.append("\n smallIcon : " + super.getSmallIconUri());
728     buf.append("\n largeIcon : " + super.getLargeIconUri());
729     buf.append("\n vendorName : " + vendorName);
730     buf.append("\n eisType : " + eisType);
731     //buf.append("\n version : " + version);
732
buf.append("\n resourceadapter version : " + resourceAdapterVersion);
733
734         //license info
735
if (getLicenseDescriptor() != null) {
736         buf.append("\n license_description : " + getLicenseDescriptor().getDescription());
737             buf.append("\n licenseRequired : " + getLicenseDescriptor().getLicenseRequiredValue());
738         }
739
740     buf.append("\n resourceAdapterClass : " + resourceAdapterClass);
741
742     buf.append("\n resourceAdapterClass [" + resourceAdapterClass
743                 + "] config properties :");
744         appendConfigProperties(this.configProperties, buf);
745             
746         if (this.outboundRA == null)
747             buf.append("\n Outbound Resource Adapter NOT available");
748         else
749         {
750             buf.append("\n Outbound Resource Adapter Info : ");
751
752             buf.append("\n connection-definitions: ");
753             for (Iterator i = this.outboundRA.getConnectionDefs().iterator();
754                  i.hasNext();)
755             {
756                 buf.append("\n------------\n");
757
758                 ConnectionDefDescriptor conDef =
759                     (ConnectionDefDescriptor) i.next();
760                 buf.append("MCF : "
761                         + conDef.getManagedConnectionFactoryImpl() + ", ");
762                 buf.append("\n MCF [" +
763                         conDef.getManagedConnectionFactoryImpl()
764                         + "] config properties :");
765                 appendConfigProperties(conDef.getConfigProperties(), buf);
766                 
767                 buf.append("[CF Interface : "
768                         + conDef.getConnectionFactoryIntf() + "], ");
769                 buf.append("[CF Class : "
770                         + conDef.getConnectionFactoryImpl() + "], ");
771                 buf.append("[Connection Interface : "
772                         + conDef.getConnectionIntf() + "], ");
773                 buf.append("[Connection Class : "
774                         + conDef.getConnectionImpl() + "] ");
775                 
776                 buf.append("\n------------\n");
777             }
778
779             buf.append("\n transaction-support : "
780                     + this.outboundRA.getTransSupport());
781             
782             buf.append("\n authentication-mechanism: ");
783             for (Iterator i = this.outboundRA.getAuthMechanisms().iterator();
784                  i.hasNext();)
785             {
786                 AuthMechanism conf = (AuthMechanism) i.next();
787                 buf.append("\n------------\n");
788                 buf.append("[Type : " + conf.getAuthMechType() + "], ");
789                 buf.append("[Interface : "
790                         + conf.getCredentialInterface() + "]");
791                 buf.append("\n------------" );
792             }
793
794             buf.append("\n reauthenticate-support : "
795                     + this.outboundRA.getReauthenticationSupport());
796
797             buf.append("\n security-permission : ");
798             for (Iterator i =
799                      getSecurityPermissions().iterator();
800                  i.hasNext();)
801             {
802                 SecurityPermission conf = (SecurityPermission) i.next();
803                 buf.append("\n------------\n");
804                 buf.append("[persmission : " + conf.getPermission() + "], ");
805                 buf.append("[discription : " + conf.getDescription() + "]");
806                 buf.append("\n------------" );
807             }
808
809         } //outbound resourceadapter
810

811         if (this.inboundRA == null)
812             buf.append("\n Inbound Resource Adapter NOT available");
813         else
814         {
815             buf.append("\n Inbound Resource Adapter Info : ");
816             
817             buf.append("\n Message Listeners Info : ");
818             for (Iterator i = this.inboundRA.getMessageListeners().iterator();
819                  i.hasNext();)
820             {
821                 buf.append("\n------------\n");
822                 MessageListener l = (MessageListener) i.next();
823                 buf.append("[Type : " + l.getMessageListenerType() + "], ");
824                 buf.append("[AS Class : " + l.getActivationSpecClass() + "]");
825                 buf.append("\n------------ ");
826             }
827             
828         } //inbound resourceadapter
829

830         
831         if (this.adminObjects.size() == 0)
832             buf.append("\n Admin Objects NOT available");
833         else
834         {
835             buf.append("\n Admin Objects Info : ");
836             for (Iterator i = this.adminObjects.iterator(); i.hasNext();)
837             {
838                 buf.append("\n------------\n");
839                 AdminObject a = (AdminObject) i.next();
840                 buf.append("[Type : " + a.getAdminObjectInterface() + "], ");
841                 buf.append("[Class : " + a.getAdminObjectClass() + "]");
842                 appendConfigProperties(a.getConfigProperties(), buf);
843                 buf.append("\n------------ ");
844             }
845             
846         } //admin objects
847

848     }
849
850     private StringBuffer JavaDoc appendConfigProperties (Set props, StringBuffer JavaDoc buf)
851     {
852         buf.append("\n------------");
853         for (Iterator i = props.iterator(); i.hasNext();)
854         {
855             EnvironmentProperty config = (EnvironmentProperty) i.next();
856             buf.append("[Name : " + config.getName() + "], ");
857             buf.append("[Value: " + config.getValue() + "], ");
858             buf.append("[Type : " + config.getType() + "]");
859         }
860         buf.append("\n------------");
861         return buf;
862     }
863     
864     /**
865      * @return the module type for this bundle descriptor
866      */

867     public ModuleType JavaDoc getModuleType() {
868         return ModuleType.RAR;
869     }
870     
871     /**
872      *@param type message listener type
873      */

874     public MessageListener getSupportedMessageListener(String JavaDoc type) {
875         if (this.inboundRA == null) {
876             return null;
877         }
878         
879         Iterator i = this.inboundRA.getMessageListeners().iterator();
880         while (i.hasNext()) {
881             MessageListener l = (MessageListener) i.next();
882             if ((l.getMessageListenerType()).equals(type)) {
883                 return l;
884             }
885         }
886         return null;
887     }
888
889     /**
890      * @deprecated
891      */

892     public boolean isMessageListenerSupported(String JavaDoc type) {
893         throw new UnsupportedOperationException JavaDoc();
894     }
895     
896     /***********************************************************************************************
897      * START
898      * Deployment Consolidation to Suppport Multiple Deployment API Clients
899      * Member Variable: sunConnector
900      * Methods: setSunDescriptor, getSunDescriptor
901      ***********************************************************************************************/

902     
903     private SunConnector sunConnector = null;
904     
905     /**
906      * This returns the extra ejb sun specific info not in the RI DID.
907      *
908      * @return object representation of connector deployment descriptor
909      */

910     public SunConnector getSunDescriptor(){
911         return sunConnector;
912     }
913     
914     /**
915      * This sets the extra connector sun specific info not in the RI DID.
916      *
917      * @param connector SunConnector object representation of connector deployment descriptor
918      */

919     public void setSunDescriptor(SunConnector connector){
920         this.sunConnector = connector;
921     }
922
923     /*******************************************************************************************
924      * END
925      * Deployment Consolidation to Suppport Multiple Deployment API Clients
926      *******************************************************************************************/

927 }
928
929
Popular Tags