Author: dkulp
Date: Thu Oct 20 19:55:39 2011
New Revision: 1187023

URL: http://svn.apache.org/viewvc?rev=1187023&view=rev
Log:
Add a "main" method to startup a standlone WS-Notification service

Added:
    
cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java   
(with props)

Added: 
cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java?rev=1187023&view=auto
==============================================================================
--- 
cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java 
(added)
+++ 
cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java 
Thu Oct 20 19:55:39 2011
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.wsn;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.cxf.wsn.jaxws.JaxwsCreatePullPoint;
+import org.apache.cxf.wsn.jaxws.JaxwsNotificationBroker;
+
+/**
+ * Starts up an instance of a WS-Notification service
+ */
+public class Service {
+    String rootURL = "http://0.0.0.0:9000/wsn";;
+    String activeMqUrl = "vm:(broker:(tcp://localhost:6000)?persistent=false)";
+
+    AbstractCreatePullPoint createPullPointServer;
+    AbstractNotificationBroker notificationBrokerServer;
+    
+    public Service(String[] args) {
+        for (int x = 0; x < args.length; x++) {
+            if ("-brokerUrl".equals(args[x])) {
+                activeMqUrl = args[++x];
+            } else if ("-rootUrl".equals(args[x])) {
+                rootURL = args[++x];
+            }
+        }
+        
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) throws Exception {
+        new Service(args).start();
+        
+    }
+
+    public void start() throws Exception {
+        ActiveMQConnectionFactory activemq = new 
ActiveMQConnectionFactory(activeMqUrl);
+
+        notificationBrokerServer = new 
JaxwsNotificationBroker("WSNotificationBroker", activemq);
+        notificationBrokerServer.setAddress(rootURL + "/NotificationBroker");
+        notificationBrokerServer.init();
+
+        createPullPointServer = new JaxwsCreatePullPoint("CreatePullPoint", 
activemq);
+        createPullPointServer.setAddress(rootURL + "/CreatePullPoint");
+        createPullPointServer.init();
+    }
+
+}

Propchange: 
cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/Service.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date


Reply via email to