Modified: 
webservices/muse/trunk/src/java/org/apache/ws/muws/v1_0/impl/advertiser/ResourceAdvertiserResource.java
URL: 
http://svn.apache.org/viewcvs/webservices/muse/trunk/src/java/org/apache/ws/muws/v1_0/impl/advertiser/ResourceAdvertiserResource.java?rev=226401&r1=226400&r2=226401&view=diff
==============================================================================
--- 
webservices/muse/trunk/src/java/org/apache/ws/muws/v1_0/impl/advertiser/ResourceAdvertiserResource.java
 (original)
+++ 
webservices/muse/trunk/src/java/org/apache/ws/muws/v1_0/impl/advertiser/ResourceAdvertiserResource.java
 Fri Jul 29 10:12:25 2005
@@ -1,4 +1,3 @@
-

 package org.apache.ws.muws.v1_0.impl.advertiser;

 

 import org.apache.ws.muws.v1_0.MuwsConstants;

@@ -26,7 +25,7 @@
 

 {

 

-        /**

+    /**

      * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls

      */

     public static final 
org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET 
= new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl();

@@ -44,81 +43,69 @@
         super.init();

 

         /**

-                * The ResourcePropertySet which contains all the defined 
ResourceProperties

-                */

-               org.apache.ws.resource.properties.ResourcePropertySet 
resourcePropertySet = getResourcePropertySet();

-               org.apache.ws.resource.properties.ResourceProperty 
resourceProperty = null;

-

-

-       try{

-               // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ManageabilityCapability
 Resource Property

-               resourceProperty = 
resourcePropertySet.get(ResourceAdvertiserPropertyQNames.MANAGEABILITYCAPABILITY);

-               
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument
 prop_manageabilitycapability = 
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument.Factory.newInstance();

-               
prop_manageabilitycapability.setManageabilityCapability(AdvertisementCapability.URI);

-               resourceProperty.add(prop_manageabilitycapability);

-

-               // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId 
Resource Property

-               resourceProperty = 
resourcePropertySet.get(ResourceAdvertiserPropertyQNames.RESOURCEID);

-               
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument 
prop_resourceid = 
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument.Factory.newInstance();

-               prop_resourceid.setResourceId(" ");  //singleton

-               resourceProperty.add(prop_resourceid);

-

-        org.apache.ws.notification.topics.TopicSpaceSet topicSpaceSet = 
getTopicSpaceSet();

-        TopicSpace topicSpace = new 
TopicSpaceImpl(MuwsConstants.NSURI_MUWS_PART2_TOPICS);

-

-        Topic manageabilityEndpointCreation = new 
XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_CREATION_NAME,
 false);

-        Topic manageabilityEndpointDestruction = new 
XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_DESTRUCTION_NAME,
 false);

-

-        XmlBeansAdvertisementTopicImpl manageableResourceCreation = new 
XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_CREATION_NAME);

-        XmlBeansAdvertisementTopicImpl manageableResourceDestruction = new 
XmlBeansAdvertisementTopicImpl(AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_DESTRUCTION_NAME);

-

-        InitialContext ctx = new InitialContext();

-        List homes = findHomes(ctx, new ArrayList(),"");

-        for (int i = 0; i < homes.size(); i++)

+         * The ResourcePropertySet which contains all the defined 
ResourceProperties

+         */

+        org.apache.ws.resource.properties.ResourcePropertySet 
resourcePropertySet = getResourcePropertySet();

+        org.apache.ws.resource.properties.ResourceProperty resourceProperty = 
null;

+

+        try

         {

-            String home = (String) homes.get(i);

-            //do not register its own home

-            if( ! home.equals(ResourceAdvertiserHome.HOME_LOCATION))

+            // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ManageabilityCapability
 Resource Property

+            resourceProperty = resourcePropertySet.get( 
ResourceAdvertiserPropertyQNames.MANAGEABILITYCAPABILITY );

+            
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument
 prop_manageabilitycapability = 
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ManageabilityCapabilityDocument.Factory.newInstance();

+            prop_manageabilitycapability.setManageabilityCapability( 
AdvertisementCapability.URI );

+            resourceProperty.add( prop_manageabilitycapability );

+

+            // init the 
{http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId 
Resource Property

+            resourceProperty = resourcePropertySet.get( 
ResourceAdvertiserPropertyQNames.RESOURCEID );

+            
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument 
prop_resourceid = 
org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument.Factory.newInstance();

+            prop_resourceid.setResourceId( " " );  //singleton

+            resourceProperty.add( prop_resourceid );

+

+            org.apache.ws.notification.topics.TopicSpaceSet topicSpaceSet = 
getTopicSpaceSet();

+            TopicSpace topicSpace = new TopicSpaceImpl( 
MuwsConstants.NSURI_MUWS_PART2_TOPICS );

+

+            Topic manageabilityEndpointCreation = new 
XmlBeansAdvertisementTopicImpl(

+                    
AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_CREATION_NAME, false );

+            Topic manageabilityEndpointDestruction = new 
XmlBeansAdvertisementTopicImpl(

+                    
AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_DESTRUCTION_NAME, false );

+

+            XmlBeansAdvertisementTopicImpl manageableResourceCreation = new 
XmlBeansAdvertisementTopicImpl(

+                    
AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_CREATION_NAME );

+            XmlBeansAdvertisementTopicImpl manageableResourceDestruction = new 
XmlBeansAdvertisementTopicImpl(

+                    
AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_DESTRUCTION_NAME );

+

+            InitialContext ctx = new InitialContext();

+            List homes = findHomes( ctx, new ArrayList(), "" );

+            for ( int i = 0; i < homes.size(); i++ )

             {

-                AbstractResourceHome absHome = (AbstractResourceHome) 
ctx.lookup(home);

-                
absHome.addResourceCreationListener(manageableResourceCreation);

-                
absHome.addResourceDestructionListener(manageableResourceDestruction);

+                String home = (String) homes.get( i );

+                if ( !home.equals( ResourceAdvertiserHome.HOME_LOCATION ) ) 
//do not register its own home

+                {

+                    AbstractResourceHome absHome = (AbstractResourceHome) 
ctx.lookup( home );

+                    absHome.addResourceCreationListener( 
manageableResourceCreation );

+                    absHome.addResourceDestructionListener( 
manageableResourceDestruction );

+                }

             }

-        }

-

-        manageabilityEndpointCreation.addTopic(manageableResourceCreation);

-        
manageabilityEndpointDestruction.addTopic(manageableResourceDestruction);

-        topicSpace.addTopic(manageabilityEndpointCreation);

-        topicSpace.addTopic(manageabilityEndpointDestruction);

-        topicSpaceSet.addTopicSpace(topicSpace);

-

-               }

-       catch (Exception e)

-       {

-          throw new javax.xml.rpc.JAXRPCException("There was a problem in 
initializing your resource properties.  Please check your init() method. Cause: 
" + e.getLocalizedMessage());

-       }

-               // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet
 is implemented by the framework.

-               // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic
 is implemented by the framework.

-               // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects
 is implemented by the framework.

-

+            manageabilityEndpointCreation.addTopic( manageableResourceCreation 
);

+            manageabilityEndpointDestruction.addTopic( 
manageableResourceDestruction );

+            topicSpace.addTopic( manageabilityEndpointCreation );

+            topicSpace.addTopic( manageabilityEndpointDestruction );

+            topicSpaceSet.addTopicSpace( topicSpace );

 

-        /**

-         * Initializes the Topic, TopicExpressionDialects and FixedTopicSet 
resource properties

-        * </br>

-        * FixedTopicSet will be set based on the value returned from the 
[EMAIL PROTECTED] TopicSpaceSet#isFixed()} method.

-        * </br>

-        * Topic will have all root topics in the TopicSpaceSet, set to Simple 
dialect AND all child topics set to

-        * Concrete dialect.

-        * </br>

-        *

-        * TopicExpressionDialects will be set to the engine's known Topic 
Dialects acquired from the TopicExpressionEngine

-        *

-        * If this is not the behavior you would like, you will need to remove 
the following line of code and initialize the properties

-        * individually.

-         */

-        
org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties(getTopicSpaceSet()
 , getResourcePropertySet());

+        }

+        catch ( Exception e )

+        {

+            throw new javax.xml.rpc.JAXRPCException(

+                    "There was a problem in initializing your resource 
properties.  Please check your init() method. Cause: " +

+                    e.getLocalizedMessage() );

         }

 

+        // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet
 is implemented by the framework.

+        // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic
 is implemented by the framework.

+        // Resource Property 
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects
 is implemented by the framework.

+

+    }

 

     /**

      * Locates the JNDI-deployed homes and returns a list containing their 
lookup strings

@@ -126,25 +113,27 @@
      * @param ctx

      * @param list

      * @param fullname

+     *

      * @return A list of homes.

+     *

      * @throws NamingException

      */

-    public List findHomes(Context ctx, List list, String fullname) throws 
NamingException

+    public List findHomes( Context ctx, List list, String fullname ) throws 
NamingException

     {

-        NamingEnumeration namingEnumeration = ctx.listBindings("");

-        while(namingEnumeration.hasMore())

+        NamingEnumeration namingEnumeration = ctx.listBindings( "" );

+        while ( namingEnumeration.hasMore() )

         {

             Binding o = (Binding) namingEnumeration.next();

             String name = o.getName();

             Object value = o.getObject();

 

-            if(name.equals("home"))

+            if ( name.equals( "home" ) )

             {

-               list.add( fullname + "/home" );

+                list.add( fullname + "/home" );

             }

-            else if (value instanceof Context)

+            else if ( value instanceof Context )

             {

-                findHomes((Context)value,list, fullname + "/" + name);

+                findHomes( (Context) value, list, fullname + "/" + name );

             }

             else

             {




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to