public class ServerFactoryBean extends AbstractWSDLBasedEndpointFactory
Service
and
expose as a server side endpoint.
If there is no Service, it can create one for you using a
ReflectionServiceFactoryBean
.
For most scenarios you'll want to just have the ServerFactoryBean handle everything for you. In such a case, usage might look like this:
ServerFactoryBean sf = new ServerFactoryBean(); sf.setServiceClass(MyService.class); sf.setAddress("http://localhost:8080/MyService"); sf.create();
You can also get more advanced and customize the service factory used:
ReflectionServiceFactory serviceFactory = new ReflectionServiceFactory(); serviceFactory.setServiceClass(MyService.class); .. \/\/ Customize service factory here... serviceFactory.setWrapped(false); ... ServerFactoryBean sf = new ServerFactoryBean(); sf.setServiceFactory(serviceFactory); sf.setAddress("http://localhost:8080/MyService"); sf.create();
address, bindingConfig, bindingFactory, bindingId, bus, conduitSelector, dataBinding, destinationFactory, endpointName, endpointReference, features, properties, publishedEndpointUrl, serviceName, transportId
Constructor and Description |
---|
ServerFactoryBean() |
ServerFactoryBean(ReflectionServiceFactoryBean sbean) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyFeatures(Server server) |
Server |
create() |
protected Invoker |
createInvoker() |
protected String |
detectTransportIdFromAddress(String ad) |
String |
getBeanName() |
Invoker |
getInvoker() |
List<String> |
getSchemaLocations() |
Server |
getServer()
For subclasses that hold onto the created Server, this will return the singleton server.
|
Object |
getServiceBean() |
Class<?> |
getServiceBeanClass() |
protected WSDLEndpointFactory |
getWSDLEndpointFactory() |
String |
getWsdlLocation() |
protected void |
initializeServiceFactory() |
boolean |
isStart()
Whether or not the Server should be started upon creation.
|
void |
setInvoker(Invoker invoker) |
void |
setSchemaLocations(List<String> schemaLocations) |
void |
setServiceBean(Object serviceBean)
Sets the bean implementing the service.
|
void |
setStart(boolean start)
Specifies if the Server should be started upon creation.
|
void |
setWsdlLocation(String location)
Specifies the location of the WSDL defining the service interface
used by the factory to create services.
|
createBindingInfo, createEndpoint, createEndpointInfo, createSoapBindingConfig, getServiceClass, getServiceFactory, getWsdlURL, setServiceClass, setServiceFactory, setWsdlURL
addToBeans, checkPrivateEndpoint, getAddress, getBindingConfig, getBindingFactory, getBindingId, getBus, getBus, getConduitSelector, getDataBinding, getDestinationFactory, getEndpointName, getFeatures, getProperties, getProperties, getPublishedEndpointUrl, getServiceName, getTransportId, initializeAnnotationInterceptors, initializeAnnotationInterceptors, initializeAnnotationInterceptors, setAddress, setBindingConfig, setBindingFactory, setBindingId, setBus, setConduitSelector, setDataBinding, setDestinationFactory, setEndpointName, setEndpointReference, setFeatures, setProperties, setPublishedEndpointUrl, setServiceName, setTransportId
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors, setInFaultInterceptors, setInInterceptors, setOutFaultInterceptors, setOutInterceptors
public ServerFactoryBean()
public ServerFactoryBean(ReflectionServiceFactoryBean sbean)
public String getBeanName()
protected String detectTransportIdFromAddress(String ad)
detectTransportIdFromAddress
in class AbstractWSDLBasedEndpointFactory
protected WSDLEndpointFactory getWSDLEndpointFactory()
getWSDLEndpointFactory
in class AbstractWSDLBasedEndpointFactory
public Server getServer()
public Server create()
protected void initializeServiceFactory()
initializeServiceFactory
in class AbstractWSDLBasedEndpointFactory
protected void applyFeatures(Server server)
protected Invoker createInvoker()
public boolean isStart()
false
if the server should not be started upon creationpublic void setStart(boolean start)
false
tells the factory that the Server will be
started manually using the start method.start
- false
specifies that the Server will not be started upon creationpublic Object getServiceBean()
public Class<?> getServiceBeanClass()
public void setServiceBean(Object serviceBean)
BeanInvoker
is created for the provided bean.serviceBean
- an instantiated implementation objectpublic Invoker getInvoker()
public void setInvoker(Invoker invoker)
public void setWsdlLocation(String location)
locaiton
- the URL of the WSDL defining the service interfacepublic String getWsdlLocation()
Apache CXF