|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.systinet.wasp.webservice.ServiceEndpoint
ServiceEndpoint represents one webservice endpoint. Using this class, one can fully setup various endpoint properties and processors affecting message processing such as handlers, interceptors etc. Common usage is as following:
ServiceEndpoint service = ServiceEndpoint.create("/HelloWorld", new HelloService()); service.set...; ... Registry.publish(service);
Field Summary | |
static int |
TYPE_JAVA
Java type of webservice. |
static int |
TYPE_RAW
Raw type of webservice. |
static int |
TYPE_XML
XML type of webservice. |
static java.lang.String |
XML_PROTOCOL_SOAP11
Deprecated. See setXMLProtocol(java.lang.String) . |
static java.lang.String |
XML_PROTOCOL_SOAP12
Deprecated. See setXMLProtocol(java.lang.String) . |
Constructor Summary | |
protected |
ServiceEndpoint()
|
Method Summary | |
abstract void |
addListener(ServiceEndpointListener listener)
Adds listener to this service endpoint. |
static ServiceEndpoint |
create(java.lang.String path,
java.lang.Class implementationClass)
Creates new instance of ServiceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
java.lang.Class implementationClass,
java.lang.Class iface)
Creates new instance of ServiceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
java.lang.Object implementationObject)
Creates new instance of ServiceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
java.lang.Object implementationObject,
java.lang.Class iface)
Creates new instance of ServiceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
ServiceEndpoint serviceEndpoint)
Creates new instance of ServiceEndpoint based on supplied serviceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
ServiceEndpoint serviceEndpoint,
java.lang.Class iface)
Creates new instance of ServiceEndpoint based on supplied serviceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
ServiceInstance serviceInstance)
Creates new instance of ServiceEndpoint. |
static ServiceEndpoint |
create(java.lang.String path,
ServiceInstance serviceInstance,
java.lang.Class iface)
Creates new instance of ServiceEndpoint. |
abstract Attributes |
getAttributes()
Retrieves attributes store bound to this service endpoint. |
abstract Configurable |
getConfigurable()
Returns the custom configuration of the service endpoint. |
abstract ServiceEndpointContext |
getContext()
Retrieves unique context bound to this service endpoint. |
abstract java.lang.Class |
getInterface()
Retrieves endpoint iface if set. |
abstract java.lang.String |
getPath()
Retrieves server path of this endpoint. |
abstract ServiceInstance |
getServiceInstance()
Retrieves service instance bound to this endpoint. |
abstract int |
getServiceType()
Retrieves type of this service endpoint based on implementation interface. |
abstract java.lang.String |
getServiceURL()
Returns the value for overriding the soap:address location attribute in returned WSDL or null if not set (and WSO2 SOA Enablement Server autodetects the proper value). |
abstract java.lang.String |
getVersion()
Returns the version of this endpoint. |
abstract Definition |
getWSDL()
Retrieves WSDL definition for this service endpoint (either set by calling setWSDL(javax.wsdl.Definition) or generated upon publishing) or
null , if this service endpoint was not
published yet and no WSDL was set by user. |
abstract java.lang.String |
getWSDLPortName()
Returns the name of service port in the WSDL definition. |
abstract QName |
getWSDLServiceName()
Returns name of selected service in the WSDL definition (see also setWSDLServiceName(javax.xml.namespace.QName) . |
abstract java.lang.String |
getXMLProtocol()
Deprecated. This methods returns XML protocol set by setXMLProtocol(java.lang.String) .
Inside any XML processing unit (e.g. JAX-RPC handler) you can get version of
used XML protocol from
CallContext (see
CallContext.XML_PROTOCOL ). |
abstract void |
removeListener(ServiceEndpointListener listener)
Removes listener form this service endpoint. |
abstract void |
setConfigurable(Configurable configurable)
Sets the custom configuration of the service service endpoint. |
abstract void |
setInterface(java.lang.Class iface)
Sets iface. |
abstract void |
setPath(java.lang.String path)
Sets the service endpoint server path. |
abstract void |
setServiceURL(java.lang.String url)
Sets the soap:address location attribute in returned WSDL. |
abstract void |
setVersion(java.lang.String version)
Sets the version of this endpoint. |
abstract void |
setWSDL(Definition wsdl)
Sets WSDL definition for this service endpoint. |
abstract void |
setWSDLPortName(java.lang.String portName)
Sets the name of service port in WSDL definition. |
abstract void |
setWSDLServiceName(QName serviceName)
Sets name of service in the WSDL definition. |
abstract void |
setXMLProtocol(java.lang.String protocol)
Deprecated. XML protocol of the service is determined by WSDL. Use Java2WSDL and
Java2WSDL.setProtocol to
generate WSDL for required XML protocol and set this WSDL to this ServiceEndpoint
with setWSDL(javax.wsdl.Definition) .
You can set XML protocol for the service with this code: ServiceEndpoint endpoint = ServiceEndpoint.create("/MyEndpoint", new MyService()); Java2WSDL java2wsdl = Java2WSDLFactory.newJava2WSDL(); java2wsdl.setProtocol(Java2WSDL.PROTOCOL_SOAP11_SOAP12); Definition wsdl = java2wsdl.generateDefinition(MyService.class); endpoint.setWSDL(wsdl); Registry.publish(endpoint); |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.systinet.wasp.webservice.Processing |
getHandlers, getHeaderProcessors, getInterceptors |
Field Detail |
public static final int TYPE_JAVA
getServiceType()
. This type
of webservice has instance which can implement arbitrary interface.
public static final int TYPE_XML
getServiceType()
. This type
of webservice has instance which must implement ReqRespListener
or OnewayListener
.
public static final int TYPE_RAW
getServiceType()
. This type
of webservice has instance which must implement RawService
.
public static final java.lang.String XML_PROTOCOL_SOAP11
setXMLProtocol(java.lang.String)
.
getXMLProtocol()
and
setXMLProtocol(java.lang.String)
.
public static final java.lang.String XML_PROTOCOL_SOAP12
setXMLProtocol(java.lang.String)
.
getXMLProtocol()
and
setXMLProtocol(java.lang.String)
.
Constructor Detail |
protected ServiceEndpoint()
Method Detail |
public static ServiceEndpoint create(java.lang.String path, java.lang.Object implementationObject)
path
- server path of created endpointimplementationObject
- implementation of endpoint
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, java.lang.Class implementationClass)
path
- server path of created endpointimplementationClass
- class of endpoint's implementation
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, java.lang.Object implementationObject, java.lang.Class iface)
path
- server path of created endpointimplementationObject
- implementation of endpointiface
- specification of methods visible after publishing
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, java.lang.Class implementationClass, java.lang.Class iface)
path
- server path of created endpointimplementationClass
- class of endpoint's implementationiface
- specification of methods visible after publishing
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, ServiceInstance serviceInstance)
path
- server path of created endpointserviceInstance
- service instance
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, ServiceInstance serviceInstance, java.lang.Class iface)
path
- server path of created endpointserviceInstance
- service instanceiface
- specification of methods visible after publishing
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, ServiceEndpoint serviceEndpoint)
path
- server path of created endpointserviceEndpoint
- source of settings for newly created endpoint
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public static ServiceEndpoint create(java.lang.String path, ServiceEndpoint serviceEndpoint, java.lang.Class iface)
path
- server path of created endpointserviceEndpoint
- source of settings for newly created endpointiface
- specification of methods visible after publishing
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public abstract Configurable getConfigurable()
public abstract void setConfigurable(Configurable configurable)
configurable
- the configuration of the service endpointpublic abstract java.lang.String getPath()
public abstract ServiceInstance getServiceInstance()
public abstract java.lang.Class getInterface()
null
.
public abstract ServiceEndpointContext getContext()
null
is returned before endpoint publishing.
Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public abstract int getServiceType()
TYPE_JAVA
,
TYPE_XML
or TYPE_RAW
.public abstract Definition getWSDL()
setWSDL(javax.wsdl.Definition)
or generated upon publishing) or
null
, if this service endpoint was not
published yet and no WSDL was set by user.
public abstract void setWSDL(Definition wsdl) throws java.lang.IllegalStateException
WSDLReader.readWSDL(java.lang.String)
, for instance:
Definition myWSDL = WSDLFactory.newInstance().newWSDLReader().readWSDL(null, "...");
wsdl
- WSDL definition.
java.lang.IllegalStateException
- when this service endpoint is already published.Registry.publish(org.systinet.wasp.webservice.ServiceEndpoint)
public abstract QName getWSDLServiceName()
setWSDLServiceName(javax.xml.namespace.QName)
.
setWSDLServiceName(javax.xml.namespace.QName)
public abstract void setWSDLServiceName(QName serviceName) throws java.lang.IllegalStateException
setWSDL(javax.wsdl.Definition)
.
serviceName
- name of service in WSDL definition
java.lang.IllegalStateException
- when this service endpoint is already published.public abstract java.lang.String getWSDLPortName()
setWSDLPortName(java.lang.String)
.
setWSDLPortName(java.lang.String)
public abstract void setWSDLPortName(java.lang.String portName) throws java.lang.IllegalStateException
setWSDL(javax.wsdl.Definition)
.
portName
- name of service port in WSDL definition
java.lang.IllegalStateException
- when this service endpoint is already published.setWSDL(javax.wsdl.Definition)
public abstract java.lang.String getXMLProtocol()
setXMLProtocol(java.lang.String)
.
Inside any XML processing unit (e.g. JAX-RPC handler) you can get version of
used XML protocol from
CallContext
(see
CallContext.XML_PROTOCOL
).
XML_PROTOCOL_SOAP11
or XML_PROTOCOL_SOAP12
public abstract void setXMLProtocol(java.lang.String protocol) throws java.lang.IllegalStateException
Java2WSDL
and
Java2WSDL.setProtocol
to
generate WSDL for required XML protocol and set this WSDL to this ServiceEndpoint
with setWSDL(javax.wsdl.Definition)
.
ServiceEndpoint endpoint = ServiceEndpoint.create("/MyEndpoint", new MyService()); Java2WSDL java2wsdl = Java2WSDLFactory.newJava2WSDL(); java2wsdl.setProtocol(Java2WSDL.PROTOCOL_SOAP11_SOAP12); Definition wsdl = java2wsdl.generateDefinition(MyService.class); endpoint.setWSDL(wsdl); Registry.publish(endpoint);
protocol
- either XML_PROTOCOL_SOAP11
or XML_PROTOCOL_SOAP12
java.lang.IllegalStateException
- when this service endpoint is already published.public abstract void setInterface(java.lang.Class iface) throws java.lang.IllegalStateException
iface
- specification of visible operations
java.lang.IllegalStateException
- when this service endpoint is already published.public abstract void setPath(java.lang.String path) throws java.lang.IllegalStateException
path
- service path
java.lang.IllegalStateException
- when this service endpoint is already published.public abstract void setServiceURL(java.lang.String url) throws java.lang.IllegalStateException
url
- service location URL used in java.lang.IllegalStateException
- when this service endpoint is already published.public abstract java.lang.String getServiceURL()
null
if not set (and WSO2 SOA Enablement Server autodetects the proper value).
setServiceURL(String)
,
but it had been set in the service deployment descriptor, the value from deployment
descriptor is returned instead.
public abstract Attributes getAttributes()
public abstract void addListener(ServiceEndpointListener listener)
listener
- listener to addpublic abstract void removeListener(ServiceEndpointListener listener)
listener
- listener to removepublic abstract void setVersion(java.lang.String version)
version
- the version, default value is "1.0"public abstract java.lang.String getVersion()
setVersion(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |