| Line 25... |
Line 25... |
| 25 |
//import org.slf4j.spi.*;
|
25 |
//import org.slf4j.spi.*;
|
| 26 |
|
26 |
|
| 27 |
import org.slf4j.Logger;
|
27 |
import org.slf4j.Logger;
|
| 28 |
import org.slf4j.LoggerFactory;
|
28 |
import org.slf4j.LoggerFactory;
|
| 29 |
|
29 |
|
| 30 |
import org.ow2.aspirerfid.ale.core.helloworld.Helloworld;
|
- |
|
| 31 |
import org.ow2.aspirerfid.ale.core.helloworld.SimpleServiceImpl;
|
- |
|
| 32 |
|
30 |
|
| 33 |
import ch.qos.logback.classic.LoggerContext;
|
31 |
import ch.qos.logback.classic.LoggerContext;
|
| 34 |
import ch.qos.logback.core.util.StatusPrinter;
|
32 |
import ch.qos.logback.core.util.StatusPrinter;
|
| 35 |
|
33 |
|
| 36 |
|
34 |
|
| Line 43... |
Line 41... |
| 43 |
|
41 |
|
| 44 |
//import org.ow2.aspirerfid.commons.ale.wsdl.alelr.ALELRService;
|
42 |
//import org.ow2.aspirerfid.commons.ale.wsdl.alelr.ALELRService;
|
| 45 |
//import org.ow2.aspirerfid.commons.ale.wsdl.ale.ALEService;
|
43 |
//import org.ow2.aspirerfid.commons.ale.wsdl.ale.ALEService;
|
| 46 |
|
44 |
|
| 47 |
public class Activator implements BundleActivator { // ServiceListener
|
45 |
public class Activator implements BundleActivator { // ServiceListener
|
| 48 |
private ServiceRegistration helloWorldRegistration;
|
- |
|
| - |
|
46 |
|
| 49 |
private ServiceRegistration aleServiceRegistration;
|
47 |
private ServiceRegistration aleServiceRegistration;
|
| 50 |
private ServiceRegistration aleLrServiceRegistration;
|
48 |
private ServiceRegistration aleLrServiceRegistration;
|
| 51 |
private ServiceRegistration registration;
|
- |
|
| - |
|
49 |
;
|
| 52 |
|
50 |
|
| 53 |
final private static String PROPERTY_BASE_NAME = "org.apache.cxf.ws";
|
51 |
final private static String PROPERTY_BASE_NAME = "org.apache.cxf.ws";
|
| 54 |
|
52 |
|
| 55 |
|
53 |
|
| 56 |
// public void serviceChanged(ServiceEvent serviceEvent) {
|
54 |
// public void serviceChanged(ServiceEvent serviceEvent) {
|
| 57 |
// // TODO Auto-generated method stub
|
55 |
// // TODO Auto-generated method stub
|
| 58 |
//
|
56 |
//
|
| 59 |
// }
|
57 |
// }
|
| 60 |
|
58 |
|
| 61 |
// props.put("service.exported.interfaces", "sample.Helloworld");
|
- |
|
| 62 |
// props.put("service.exported.configs", PROPERTY_BASE_NAME);
|
- |
|
| 63 |
//
|
- |
|
| 64 |
// // If the property bellow is not used, the URL used for the web service should be:
|
- |
|
| 65 |
// // http://localhost:9000/sample/Helloworld
|
- |
|
| 66 |
// props.put(PROPERTY_BASE_NAME + ".address", "http://localhost:9090/SimpleService");
|
- |
|
| 67 |
//
|
59 |
|
| 68 |
// props.put(PROPERTY_BASE_NAME + ".frontend", "jaxws");
|
- |
|
| 69 |
// props.put(PROPERTY_BASE_NAME + ".service.ns", "http://sample/"); // service namespace
|
- |
|
| 70 |
// props.put(PROPERTY_BASE_NAME + ".service.name", "Helloworld"); // service name
|
- |
|
| 71 |
// props.put(PROPERTY_BASE_NAME + ".port.name", "HelloworldSOAP11Port"); // port/endpoint name
|
- |
|
| 72 |
// props.put(PROPERTY_BASE_NAME + ".location", "wsdl/Helloworld.wsdl");
|
- |
|
| 73 |
|
60 |
|
| 74 |
|
61 |
|
| 75 |
|
62 |
|
| 76 |
public void start(BundleContext bundleContext) throws Exception {
|
63 |
public void start(BundleContext bundleContext) throws Exception {
|
| 77 |
|
64 |
|
| Line 91... |
Line 78... |
| 91 |
aleDictionaryProps.put("service.exported.interfaces", "org.ow2.aspirerfid.commons.ale.wsdl.ale.ALEServicePortType");
|
78 |
aleDictionaryProps.put("service.exported.interfaces", "org.ow2.aspirerfid.commons.ale.wsdl.ale.ALEServicePortType");
|
| 92 |
aleDictionaryProps.put("service.exported.configs", "org.apache.cxf.ws");
|
79 |
aleDictionaryProps.put("service.exported.configs", "org.apache.cxf.ws");
|
| 93 |
aleDictionaryProps.put("org.apache.cxf.ws.address", aleServiceURL);
|
80 |
aleDictionaryProps.put("org.apache.cxf.ws.address", aleServiceURL);
|
| 94 |
|
81 |
|
| 95 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".frontend", "jaxws");
|
82 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".frontend", "jaxws");
|
| 96 |
// aleDictionaryProps.put("org.apache.cxf.ws.databinding","jaxb");
|
83 |
aleDictionaryProps.put("org.apache.cxf.ws.databinding","jaxb");
|
| 97 |
// aleDictionaryProps.put(PROPERTY_BASE_NAME + ".service.ns", "http://ale.wsdl.ale.commons.aspirerfid.ow2.org"); // service namespace
|
84 |
// aleDictionaryProps.put(PROPERTY_BASE_NAME + ".service.ns", "http://ale.wsdl.ale.commons.aspirerfid.ow2.org"); // service namespace
|
| 98 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".service.name", "ALEService"); // service name
|
85 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".service.name", "ALEService"); // service name
|
| 99 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".port.name", "ALEServicePort"); // port/endpoint name
|
86 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".port.name", "ALEServicePort"); // port/endpoint name
|
| 100 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".location", "epcglobal/ale/EPCglobal-ale-1_1-ale.wsdl");
|
87 |
aleDictionaryProps.put(PROPERTY_BASE_NAME + ".location", "epcglobal/ale/EPCglobal-ale-1_1-ale.wsdl");
|
| 101 |
// aleDictionaryProps.put("org.apache.cxf.ws.wsdl.location","epcglobal/ale/EPCglobal-ale-1_1-ale.wsdl");
|
- |
|
| 102 |
// aleDictionaryProps.put("org.apache.cxf.ws.wsdl.service.ns","localhost");
|
- |
|
| 103 |
// aleDictionaryProps.put("org.apache.cxf.ws.wsdl.service.name","ALEService");
|
- |
|
| 104 |
// aleDictionaryProps.put("org.apache.cxf.ws.wsdl.port.name","9090");
|
- |
|
| - |
|
88 |
|
| 105 |
|
89 |
|
| 106 |
|
90 |
|
| 107 |
|
91 |
|
| 108 |
|
92 |
|
| 109 |
|
93 |
|
| 110 |
aleServiceRegistration = bundleContext.registerService(ALEServicePortType.class.getName(),
|
94 |
aleServiceRegistration = bundleContext.registerService(ALEServicePortType.class.getName(),
|
| 111 |
new ALEServicePortTypeImpl(), aleDictionaryProps);
|
95 |
new ALEServicePortTypeImpl(), aleDictionaryProps);
|
| 112 |
|
96 |
|
| 113 |
System.out.println("#########Service listens to : "+aleServiceURL+" #########");
|
97 |
System.out.println("#########Service listens to : "+aleServiceURL+" #########");
|
| 114 |
|
98 |
|
| 115 |
// ===================Initialize ALELR Service ===========
|
99 |
// ===================Initialize ALELR Service (using CXF 'simple' frontend) ===========
|
| 116 |
|
100 |
|
| 117 |
Dictionary aleLrDictionaryProps = new Hashtable();
|
101 |
Dictionary aleLrDictionaryProps = new Hashtable();
|
| 118 |
String aleLrServiceURL = bundleContext.getProperty("org.ow2.aspirerfid.ale.core.aleLrServiceURL");
|
102 |
String aleLrServiceURL = bundleContext.getProperty("org.ow2.aspirerfid.ale.core.aleLrServiceURL");
|
| 119 |
|
103 |
|
| 120 |
aleLrDictionaryProps.put("service.exported.interfaces", "*");
|
104 |
aleLrDictionaryProps.put("service.exported.interfaces", "*");
|
| Line 125... |
Line 109... |
| 125 |
new ALELRServicePortTypeImpl(), aleLrDictionaryProps);
|
109 |
new ALELRServicePortTypeImpl(), aleLrDictionaryProps);
|
| 126 |
|
110 |
|
| 127 |
System.out.println("#########Service listens to : "+aleLrServiceURL+" #########");
|
111 |
System.out.println("#########Service listens to : "+aleLrServiceURL+" #########");
|
| 128 |
|
112 |
|
| 129 |
|
113 |
|
| 130 |
|
- |
|
| 131 |
|
- |
|
| 132 |
// ===================Initialize Hello World (using CXF JAX-WS frontend) Services ===========
|
- |
|
| 133 |
|
- |
|
| 134 |
Dictionary props = new Hashtable();
|
- |
|
| 135 |
|
- |
|
| 136 |
props.put("service.exported.interfaces", "org.ow2.aspirerfid.ale.core.helloworld.Helloworld");
|
- |
|
| 137 |
props.put("service.exported.configs", PROPERTY_BASE_NAME);
|
- |
|
| 138 |
|
- |
|
| 139 |
// If the property bellow is not used, the URL used for the web service should be:
|
- |
|
| 140 |
// http://localhost:9000/sample/Helloworld
|
- |
|
| 141 |
props.put(PROPERTY_BASE_NAME + ".address", "http://localhost:9090/SimpleService");
|
- |
|
| 142 |
|
- |
|
| 143 |
props.put(PROPERTY_BASE_NAME + ".frontend", "jaxws");
|
- |
|
| 144 |
props.put(PROPERTY_BASE_NAME + ".service.ns", "http://sample/"); // service namespace
|
- |
|
| 145 |
props.put(PROPERTY_BASE_NAME + ".service.name", "Helloworld"); // service name
|
- |
|
| 146 |
props.put(PROPERTY_BASE_NAME + ".port.name", "HelloworldSOAP11Port"); // port/endpoint name
|
- |
|
| 147 |
props.put(PROPERTY_BASE_NAME + ".location", "Helloworld.wsdl");
|
- |
|
| 148 |
|
- |
|
| 149 |
registration = bundleContext.registerService(Helloworld.class.getName(), new SimpleServiceImpl(), props);
|
- |
|
| 150 |
// ===================Initialize Hello World (using CXF 'simple' frontend) Services ===========
|
- |
|
| 151 |
|
- |
|
| 152 |
// Dictionary<String, String> helloWorldDictionaryProps = new Hashtable<String, String>();
|
- |
|
| 153 |
//
|
- |
|
| 154 |
//
|
- |
|
| 155 |
// helloWorldDictionaryProps.put("service.exported.interfaces", "*");
|
- |
|
| 156 |
// helloWorldDictionaryProps.put("service.exported.configs", "org.apache.cxf.ws");
|
- |
|
| 157 |
// helloWorldDictionaryProps.put("org.apache.cxf.ws.address", "http://localhost:9090/HelloWorld");
|
- |
|
| 158 |
//
|
- |
|
| 159 |
// helloWorldRegistration = bundleContext.registerService(HelloWorldService.class.getName(),
|
- |
|
| 160 |
// new HelloWorldServiceImpl(), helloWorldDictionaryProps);
|
- |
|
| 161 |
//
|
- |
|
| 162 |
// System.out.println("#########Service listens to : http://localhost:9090/HelloWorld #########");
|
- |
|
| 163 |
|
114 |
|
| 164 |
|
115 |
|
| 165 |
|
116 |
|
| 166 |
logger.debug("Hello world by Logger. From : {}",Activator.class.getName());
|
117 |
logger.debug("Hello world by Logger. From : {}",Activator.class.getName());
|
| 167 |
|
118 |
|
| Line 169... |
Line 120... |
| 169 |
|
120 |
|
| 170 |
public void stop(BundleContext arg0) throws Exception {
|
121 |
public void stop(BundleContext arg0) throws Exception {
|
| 171 |
System.out.println("Goodbye World");
|
122 |
System.out.println("Goodbye World");
|
| 172 |
aleServiceRegistration.unregister();
|
123 |
aleServiceRegistration.unregister();
|
| 173 |
aleLrServiceRegistration.unregister();
|
124 |
aleLrServiceRegistration.unregister();
|
| 174 |
helloWorldRegistration.unregister();
|
- |
|
| - |
|
125 |
|
| 175 |
|
126 |
|
| 176 |
}
|
127 |
}
|
| 177 |
|
128 |
|
| 178 |
}
|
129 |
}
|