From: <st...@us...> - 2007-01-10 12:16:32
|
Revision: 3793 http://svn.sourceforge.net/smartfrog/?rev=3793&view=rev Author: steve_l Date: 2007-01-10 04:14:56 -0800 (Wed, 10 Jan 2007) Log Message: ----------- more muws stuff Modified Paths: -------------- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/muws/MuwsEventHandler.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/StatsHandler.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WSNotifyHandler.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WSNConstants.java trunk/core/components/deployapi/test/log4j.properties trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/api_tests.sf trunk/projects/alpine/prototype/M32/src/java/org/smartfrog/projects/alpine/handlers/LogCurrentMessageHandler.java Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/engine/ServerInstance.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -27,6 +27,7 @@ import org.apache.commons.logging.LogFactory; import org.ggf.cddlm.generated.api.CddlmConstants; import org.smartfrog.projects.alpine.om.base.SoapElement; +import org.smartfrog.projects.alpine.faults.AlpineRuntimeException; import org.smartfrog.services.deployapi.binding.DescriptorHelper; import org.smartfrog.services.deployapi.binding.XomHelper; import org.smartfrog.services.deployapi.components.DeploymentServer; @@ -237,14 +238,24 @@ * get the current instance; bailing out if none exists * * @return the current instance + * @throws AlpineRuntimeException if needed */ public static ServerInstance currentInstance() { if (instance == null) { - throw new RuntimeException("No configured ServerInstance"); + throw new AlpineRuntimeException("No configured ServerInstance"); } return instance; } + + /** + * Get the server or null if none is defined + * @return the current server instance + */ + public static ServerInstance getServerInstanceOrNull() { + return instance; + } + public DescriptorHelper getDescriptorHelper() { return descriptorHelper; } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/muws/MuwsEventHandler.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/muws/MuwsEventHandler.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/notifications/muws/MuwsEventHandler.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -59,16 +59,21 @@ */ protected boolean notificationReceived(MessageContext messageContext) { try { - SoapElement request = getRequest(messageContext); - SoapElement message = (SoapElement) request.getFirstChildElement(WSNT_MESSAGE, Constants.WSRF_WSNT_NAMESPACE); + SoapElement notify = getRequest(messageContext); + SoapElement notification = (SoapElement) notify.getFirstChildElement( + WSNT_NOTIFICATION_MESSAGE, + Constants.WSRF_WSNT_NAMESPACE); + SoapElement message = (SoapElement) notification.getFirstChildElement(WSNT_MESSAGE, + Constants.WSRF_WSNT_NAMESPACE); if (message == null) { - throw new AlpineRuntimeException("No wsnt:" + WSNT_MESSAGE+ " found in the request "+request.toXML()); + throw new AlpineRuntimeException("No wsnt:" + WSNT_MESSAGE+ " found in the request "+ notify + .toXML()); } SoapElement event = (SoapElement) message.getFirstChildElement(MUWS_MANAGEMENT_EVENT, Constants.MUWS_P1_NAMESPACE); if (event == null) { throw new AlpineRuntimeException("No muws-p1:" + MUWS_MANAGEMENT_EVENT + " found in the request" - +request.toXML()); + + notify.toXML()); } return muwsEventReceived(messageContext,event); } catch (AlpineRuntimeException e) { Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/StatsHandler.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/StatsHandler.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/StatsHandler.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -54,7 +54,7 @@ synchronized (this) { requests++; } - ServerInstance serverInstance = ServerInstance.currentInstance(); + ServerInstance serverInstance = ServerInstance.getServerInstanceOrNull(); if (serverInstance != null) { serverInstance.incrementRequests(); } @@ -64,7 +64,7 @@ synchronized (this) { failures++; } - ServerInstance serverInstance = ServerInstance.currentInstance(); + ServerInstance serverInstance = ServerInstance.getServerInstanceOrNull(); if(serverInstance!=null) { serverInstance.incrementFailures(); } Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WSNotifyHandler.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WSNotifyHandler.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/WSNotifyHandler.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -49,7 +49,7 @@ return; } - if (WSNT_NOTIFICATION_MESSAGE.equals(getRequestName(messageContext))) { + if (WSNT_NOTIFY.equals(getRequestName(messageContext))) { verifyNamespace(getRequest(messageContext), Constants.WSRF_WSNT_NAMESPACE); Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/endpoints/alpine/handlers.sf 2007-01-10 12:14:56 UTC (rev 3793) @@ -105,20 +105,6 @@ } - -DeployApiEndpoint extends AlpineEndpoint { - pivotHandler TBD; - - - getMessage ## - <html> - <head><title>Deployment Endpoint</title><head> - <body>This a demo endpoint of the HP implementation of the CDDLM Deployment system</body> - </html> - #; - -} - SubscriptionEndpoint extends AlpineEndpoint { name "subscriptions"; path "/subscription/"; Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/NotificationSubscription.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -331,7 +331,11 @@ } protected SoapElement createNotificationMessage(AlpineEPR producer, Element message) { - SoapElement notificationMessage = new SoapElement("wsnt:"+ WSNT_NOTIFICATION_MESSAGE, Constants.WSRF_WSNT_NAMESPACE); + SoapElement notifyElt = new SoapElement("wsnt:" + WSNT_NOTIFY, + Constants.WSRF_WSNT_NAMESPACE); + SoapElement notificationMessage = new SoapElement("wsnt:"+ WSNT_NOTIFICATION_MESSAGE, + Constants.WSRF_WSNT_NAMESPACE); + notifyElt.appendChild(notificationMessage); SoapElement topicElt = new SoapElement("wsnt:"+ WSNT_TOPIC, Constants.WSRF_WSNT_NAMESPACE); WsrfUtils.addSimpleDialectAttribute(topicElt); topicElt.appendQName(topic); @@ -339,7 +343,7 @@ if (producer != null) { notificationMessage.appendChild( producer.toXomInNewNamespace(WSNT_PRODUCER_REFERENCE, Constants.WSRF_WSNT_NAMESPACE, - "wsnt", Constants.WS_ADDRESSING_2004_NAMESPACE, "wsa2004")); + "wsnt", Constants.WS_ADDRESSING_NAMESPACE, "wsa2003")); } if (message != null) { SoapElement messageElt = new SoapElement("wsnt:"+ WSNT_MESSAGE, Constants.WSRF_WSNT_NAMESPACE); Modified: trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WSNConstants.java =================================================================== --- trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WSNConstants.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/transport/wsrf/WSNConstants.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -60,6 +60,7 @@ String MUWS_SOURCE_COMPONENT = "SourceComponent"; String MUWS_RESOURCE_ID = "ResourceId"; String WSNT_NOTIFICATION_MESSAGE = "NotificationMessage"; + String WSNT_NOTIFY = "Notify"; String WSNT_PRODUCER_REFERENCE = "ProducerReference"; String WSNT_MESSAGE = "Message"; String WSNT_TOPIC = "Topic"; Modified: trunk/core/components/deployapi/test/log4j.properties =================================================================== --- trunk/core/components/deployapi/test/log4j.properties 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/test/log4j.properties 2007-01-10 12:14:56 UTC (rev 3793) @@ -5,7 +5,7 @@ log4j.rootCategory=INFO, CONSOLE,WWW #wire debugging of HTTP client -#log4j.logger.httpclient.wire=DEBUG +log4j.logger.httpclient.wire=DEBUG log4j.logger.org.smartfrog=INFO log4j.logger.org.smartfrog.sfcore.languages.cdl=DEBUG Modified: trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/api_tests.sf =================================================================== --- trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/api_tests.sf 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/core/components/deployapi/test/org/smartfrog/services/deployapi/test/system/alpine/deployapi/api/api_tests.sf 2007-01-10 12:14:56 UTC (rev 3793) @@ -29,8 +29,6 @@ AlpineTestSuite extends JUnit3TestSuite { name "alpine"; - enabled true; - if enabled; //full path to the echo endpoint endpoint TBD; properties [ @@ -187,42 +185,42 @@ portal extends PortalTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } creation extends CreationTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } initialization extends InitializationTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } lifecycle extends LifecycleTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } notification extends NotificationTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } informative extends InformativeTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } other extends OtherTestSuite { singleTest singleClass; endpoint LAZY PARENT:endpoint; - enabled PARENT:enabled; + if PARENT:enabled; } } Modified: trunk/projects/alpine/prototype/M32/src/java/org/smartfrog/projects/alpine/handlers/LogCurrentMessageHandler.java =================================================================== --- trunk/projects/alpine/prototype/M32/src/java/org/smartfrog/projects/alpine/handlers/LogCurrentMessageHandler.java 2007-01-10 12:12:37 UTC (rev 3792) +++ trunk/projects/alpine/prototype/M32/src/java/org/smartfrog/projects/alpine/handlers/LogCurrentMessageHandler.java 2007-01-10 12:14:56 UTC (rev 3793) @@ -51,13 +51,15 @@ //log the sender request String address = (String) messageContext.get(ContextConstants.REQUEST_REMOTE_ADDRESS); if (address != null) { - log.info("Message from IP address " + address); + log.info("Message "+ + (messageContext.isProcessed()?"to":"from") + +" IP address " + address); } MessageDocument currentMessage = messageContext.getCurrentMessage(); if (currentMessage == null) { log.error("There is no current message"); } else { - final MessageDocument document = messageContext.getCurrentMessage(); + MessageDocument document = messageContext.getCurrentMessage(); log.info(XsdUtils.printToString(document)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |