You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by ki...@apache.org on 2005/08/02 16:03:18 UTC

svn commit: r227006 - in /webservices/muse/trunk/src/examples/enterprise/services/application/src: java/org/apache/ws/muse/example/application/ wsdl/

Author: kidz
Date: Tue Aug  2 07:03:13 2005
New Revision: 227006

URL: http://svn.apache.org/viewcvs?rev=227006&view=rev
Log:
Support for muse-ext properties, refactored for intercace changes

Modified:
    webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationHome.java
    webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationPropertyQNames.java
    webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationResource.java
    webservices/muse/trunk/src/examples/enterprise/services/application/src/wsdl/application.wsdl

Modified: webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationHome.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationHome.java?rev=227006&r1=227005&r2=227006&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationHome.java (original)
+++ webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationHome.java Tue Aug  2 07:03:13 2005
@@ -16,7 +16,6 @@
 package org.apache.ws.muse.example.application;
 
 import org.apache.ws.addressing.EndpointReference;
-import org.apache.ws.muse.example.ExampleConstants;
 import org.apache.ws.muse.example.resourceadmin.properties.CreateParamsType;
 import org.apache.ws.resource.Resource;
 import org.apache.ws.resource.ResourceContext;
@@ -138,10 +137,6 @@
       {
          // resource = createInstance(aKey);
          resource = new ApplicationResource( resourceId, params );
-
-         //The EPRs should be build using "http://schemas.xmlsoap.org/ws/2003/03/addressing" addressing namespace. It introduces spec conflicts
-         //To work around thes problem the "http://schemas.xmlsoap.org/ws/2004/08/addressing" is used as namespace for addressing
-         //EndpointReference epr = getEndpointReference(resourceContext.getBaseURL(  ) + "/" + getServiceName().getLocalPart() , null, SPEC_NAMESPACE_SET.getAddressingNamespace());
          EndpointReference epr =
             getEndpointReference( resourceId );
          ( (ApplicationResource) resource ).setEndpointReference( epr );

Modified: webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationPropertyQNames.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationPropertyQNames.java?rev=227006&r1=227005&r2=227006&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationPropertyQNames.java (original)
+++ webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationPropertyQNames.java Tue Aug  2 07:03:13 2005
@@ -27,72 +27,42 @@
  */
 public interface ApplicationPropertyQNames
 {
-   /** DOCUMENT_ME */
-   QName TOTALNUMBEROFREQUESTS =
-      new QName( "http://ws.apache.org/muse/example/application/properties", "TotalNumberOfRequests", "app-prop" );
-
-   /** DOCUMENT_ME */
-   QName TOPICEXPRESSIONDIALECTS =
-      new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd",
-                 "TopicExpressionDialects", "wsnt" );
-
-   /** DOCUMENT_ME */
-   QName RESOURCEID =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd", "ResourceId", "muws-p1-xs" );
-
-   /** DOCUMENT_ME */
-   QName CUMULATIVEEXECUTIONTIME =
-      new QName( "http://ws.apache.org/muse/example/shared", "CumulativeExecutionTime", "example-wsf" );
-
-   /** DOCUMENT_ME */
-   QName RESOURCEHOSTNAME =
-      new QName( "http://ws.apache.org/namespaces/muse/muws-ext-1.xsd", "ResourceHostname", "ws-ext" );
-
-   /** DOCUMENT_ME */
-   QName VERSION =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Version", "muws-p2-xs" );
-
-   /** DOCUMENT_ME */
-   QName MANAGEABILITYCAPABILITY =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd", "ManageabilityCapability",
-                 "muws-p1-xs" );
-
-   /** DOCUMENT_ME */
-   QName CAPTION =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Caption", "muws-p2-xs" );
-
-   /** DOCUMENT_ME */
-   QName NUMBEROFOUTSTANDINGREQUESTS =
-      new QName( "http://ws.apache.org/muse/example/application/properties", "NumberOfOutstandingRequests",
-                 "app-prop" );
-
-   /** DOCUMENT_ME */
-   QName DESCRIPTION =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Description", "muws-p2-xs" );
-
-   /** DOCUMENT_ME */
-   QName OPERATIONALSTATUS =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "OperationalStatus",
-                 "muws-p2-xs" );
-
-   /** DOCUMENT_ME */
-   QName FIXEDTOPICSET =
-      new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd",
-                 "FixedTopicSet", "wsnt" );
-
-   /** DOCUMENT_ME */
-   QName CURRENTTIME =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "CurrentTime", "muws-p2-xs" );
-
-   /** DOCUMENT_ME */
-   QName RESOURCETYPE =
-      new QName( "http://ws.apache.org/namespaces/muse/muws-ext-1.xsd", "ResourceType", "ws-ext" );
-
-   /** DOCUMENT_ME */
-   QName RELATIONSHIP =
-      new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Relationship", "muws-p2-xs" );
-
-   /** DOCUMENT_ME */
-   QName TOPIC =
-      new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic", "wsnt" );
-}
\ No newline at end of file
+    
+            QName TOTALNUMBEROFREQUESTS =
+            new QName( "http://ws.apache.org/muse/example/application/properties", "TotalNumberOfRequests", "app-prop");        
+            QName TOPICEXPRESSIONDIALECTS =
+            new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "TopicExpressionDialects", "wsnt");        
+            QName RESOURCEID =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd", "ResourceId", "muws-p1-xs");        
+            QName CUMULATIVEEXECUTIONTIME =
+            new QName( "http://ws.apache.org/muse/example/shared", "CumulativeExecutionTime", "example-wsf");        
+            QName CREATIONTIME =
+            new QName( "http://ws.apache.org/namespaces/muse/muws-ext-1.xsd", "CreationTime", "ws-ext");        
+            QName RESOURCEHOSTNAME =
+            new QName( "http://ws.apache.org/namespaces/muse/muws-ext-1.xsd", "ResourceHostname", "ws-ext");        
+            QName VERSION =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Version", "muws-p2-xs");        
+            QName CAPTION =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Caption", "muws-p2-xs");        
+            QName MANAGEABILITYCAPABILITY =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd", "ManageabilityCapability", "muws-p1-xs");        
+            QName NUMBEROFOUTSTANDINGREQUESTS =
+            new QName( "http://ws.apache.org/muse/example/application/properties", "NumberOfOutstandingRequests", "app-prop");        
+            QName DESCRIPTION =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Description", "muws-p2-xs");        
+            QName FIXEDTOPICSET =
+            new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "FixedTopicSet", "wsnt");        
+            QName OPERATIONALSTATUS =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "OperationalStatus", "muws-p2-xs");        
+            QName CURRENTTIME =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "CurrentTime", "muws-p2-xs");        
+            QName RESOURCETYPE =
+            new QName( "http://ws.apache.org/namespaces/muse/muws-ext-1.xsd", "ResourceType", "ws-ext");        
+            QName OWNER =
+            new QName( "http://ws.apache.org/namespaces/muse/muws-ext-1.xsd", "Owner", "ws-ext");        
+            QName RELATIONSHIP =
+            new QName( "http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd", "Relationship", "muws-p2-xs");        
+            QName TOPIC =
+            new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic", "wsnt");        
+    
+}

Modified: webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationResource.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationResource.java?rev=227006&r1=227005&r2=227006&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationResource.java (original)
+++ webservices/muse/trunk/src/examples/enterprise/services/application/src/java/org/apache/ws/muse/example/application/ApplicationResource.java Tue Aug  2 07:03:13 2005
@@ -15,6 +15,8 @@
  *=============================================================================*/
 package org.apache.ws.muse.example.application;
 
+import java.util.Calendar;
+
 import org.apache.ws.mows.v1_0.MowsConstants;
 import org.apache.ws.mows.v1_0.capability.MetricsCapability;
 import org.apache.ws.mows.v1_0.capability.OperationalStatusCapability;
@@ -40,8 +42,8 @@
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipParticipantType;
 import org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipType;
-import java.util.Calendar;
-
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 /**
  *
  *  * @author Kinga Dziembowski
@@ -78,6 +80,9 @@
     */
    private EventScheduler m_eventScheduler;
 
+   /** A log object */
+   private static final Log LOG = LogFactory.getLog( ApplicationResource.class.getName() );
+
    /**
     * Creates a new {@link ApplicationResource} object.
     *
@@ -92,7 +97,7 @@
       // in this example it is not used
    }
 
-   // not exposed by WSDM utility operation to set the relationship for the resource
+   // not exposed by WSDM, utility operation to set the relationship for the resource
    public void setRelationship( org.apache.ws.muse.example.resourceadmin.properties.SetRelationshipDocument requestDoc )
    throws Exception
    {
@@ -122,6 +127,10 @@
 
          relationshipType.setParticipantArray( participants );
          resourceProperty.add( prop_relationship );
+         if ( LOG.isDebugEnabled() )
+         {
+             LOG.debug( "SetRelationship -   " + prop_relationship );
+         }
       }
       else
       {
@@ -151,11 +160,11 @@
         /* MUWS TopicSpace is returned by MuwsUtils.addRelationshipTopics - This utility operation adds relationship topics support. I
  	     * nternaly the code :
  	     * TopicSpace muwsTopicSpace = new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS )
- 	     * aSet.addTopicSpace( muwsTopicSpace ) is executed. We are adding more MUWS topics to this 
+ 	     * aSet.addTopicSpace( muwsTopicSpace ) is executed. We are adding more MUWS topics to this
  	     * TopicSpace.
- 	    */         
+ 	    */
  	     TopicSpace muwsTopicSpace = MuwsUtils.addRelationshipTopics( aSet );
-     
+
          ManagementEventTopic identityCapability =
             new XmlBeansManagementEventTopicImpl( IdentityCapability.TOPIC_NAME );
          muwsTopicSpace.addTopic( identityCapability );
@@ -322,37 +331,31 @@
          resourceProperty.add( prop_resourcetype );
 
          // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}Relationship Resource Property
-         /*resourceProperty = resourcePropertySet.get(ApplicationPropertyQNames.RELATIONSHIP);
-		 org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship = org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance();
-		 resourceProperty.add(prop_relationship);
-*/
-         /*
-         resourceProperty = resourcePropertySet.get( ApplicationPropertyQNames.RELATIONSHIP );
-         org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship    =
-            org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance(  );
-         RelationshipDocument                                                      relationshipDocument =
-            RelationshipDocument.Factory.newInstance(  );
-
-         //add new type
-         RelationshipType     relationshipType     = relationshipDocument.addNewRelationship(  );
-         RelationshipTypeType relationshipTypeType = relationshipType.addNewType(  );
-         XmlObject            relationType         =
-            XmlObject.Factory.parse( "<" + ExampleConstants.RELATIONSHIP_RELATION.getPrefix(  ) + ":"
-                                     + ExampleConstants.RELATIONSHIP_RELATION.getLocalPart(  ) + " xmlns:"
-                                     + ExampleConstants.RELATIONSHIP_RELATION.getPrefix(  ) + "=" + "\""
-                                     + ExampleConstants.RELATIONSHIP_RELATION.getNamespaceURI(  ) + "\" />" );
-         XmlBeanUtils.addChildElement( relationshipTypeType, relationType );
-         prop_relationship.setRelationship( relationshipType );
-         resourceProperty.add( prop_relationship );
-         */
 
-         //		 init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}CurrentTime ResourceProperty
+         //	 init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd}CurrentTime ResourceProperty
          resourceProperty = resourcePropertySet.get( ApplicationPropertyQNames.CURRENTTIME );
          CurrentTimeDocument currentTimeDocument = CurrentTimeDocument.Factory.newInstance(  );
          currentTimeDocument.setCurrentTime( Calendar.getInstance(  ) );
          resourceProperty.add( currentTimeDocument );
          resourceProperty.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback(  ) );
          resourceProperty.addChangeListener( metricCapability );
+
+         // init the {http://ws.apache.org/namespaces/muse/muws-ext-1.xsd}Owner Resource Property
+         resourceProperty = resourcePropertySet.get(ApplicationPropertyQNames.OWNER);
+ 		org.apache.ws.namespaces.muse.muwsExt1.OwnerDocument prop_owner = org.apache.ws.namespaces.muse.muwsExt1.OwnerDocument.Factory.newInstance();
+ 		org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.LangString oString =  LangString.Factory.newInstance(  );
+ 		oString.setStringValue( ExampleConstants.APPLICATION_OWNER );
+ 		oString.setLang( "en" );
+         prop_owner.setOwner( oString );
+ 		resourceProperty.add(prop_owner);
+
+ 		// init the {http://ws.apache.org/namespaces/muse/muws-ext-1.xsd}CreationTime Resource Property
+ 		resourceProperty = resourcePropertySet.get(ApplicationPropertyQNames.CREATIONTIME);
+ 		org.apache.ws.namespaces.muse.muwsExt1.CreationTimeDocument prop_creationtime = org.apache.ws.namespaces.muse.muwsExt1.CreationTimeDocument.Factory.newInstance();
+ 		prop_creationtime.setCreationTime(Calendar.getInstance(  ));
+ 		resourceProperty.add(prop_creationtime);
+
+
       }
       catch ( Exception e )
       {
@@ -364,7 +367,7 @@
       // 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.
 
-      //m_eventScheduler.start(1, 60 );
+
    }
 
    /**
@@ -490,9 +493,9 @@
       }
       catch ( java.net.UnknownHostException uhe )
       {
-         System.out.println( "Error getting HostName" );
+      	uhe.printStackTrace();
       }
 
       return name;
    }
-}
\ No newline at end of file
+}

Modified: webservices/muse/trunk/src/examples/enterprise/services/application/src/wsdl/application.wsdl
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/enterprise/services/application/src/wsdl/application.wsdl?rev=227006&r1=227005&r2=227006&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/enterprise/services/application/src/wsdl/application.wsdl (original)
+++ webservices/muse/trunk/src/examples/enterprise/services/application/src/wsdl/application.wsdl Tue Aug  2 07:03:13 2005
@@ -140,6 +140,8 @@
                   
                   <element ref="ws-ext:ResourceType" minOccurs="1" maxOccurs="1" /> 
                   <element ref="ws-ext:ResourceHostname" minOccurs="1" maxOccurs="1" /> 
+                  <element ref="ws-ext:CreationTime" minOccurs="1" maxOccurs="1" /> 
+                  <element ref="ws-ext:Owner" minOccurs="1" maxOccurs="1" /> 
                   
                   <!--   SPECIFIC PROPERTIES DEFINED IN APPLICATION.XSD -->
                   



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org