org.apache.cxf.frontend
Class ServerFactoryBean

java.lang.Object
  extended by org.apache.cxf.interceptor.AbstractBasicInterceptorProvider
      extended by org.apache.cxf.endpoint.AbstractEndpointFactory
          extended by org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory
              extended by org.apache.cxf.frontend.ServerFactoryBean
All Implemented Interfaces:
org.apache.cxf.interceptor.InterceptorProvider

public class ServerFactoryBean
extends AbstractWSDLBasedEndpointFactory

This class helps take a 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();
 


Field Summary
 
Fields inherited from class org.apache.cxf.endpoint.AbstractEndpointFactory
address, bindingConfig, bindingFactory, bindingId, bus, conduitSelector, dataBinding, destinationFactory, endpointName, endpointReference, features, properties, publishedEndpointUrl, serviceName, transportId
 
Constructor Summary
ServerFactoryBean()
           
ServerFactoryBean(ReflectionServiceFactoryBean sbean)
           
 
Method Summary
protected  void applyExtraClass()
           
protected  void applyFeatures()
           
 org.apache.cxf.endpoint.Server create()
           
protected  org.apache.cxf.service.invoker.Invoker createInvoker()
           
 java.lang.String getBeanName()
           
 org.apache.cxf.service.invoker.Invoker getInvoker()
           
 java.util.List<java.lang.String> getSchemaLocations()
           
 org.apache.cxf.endpoint.Server getServer()
           
 java.lang.Object getServiceBean()
           
 java.lang.Class<?> getServiceBeanClass()
           
protected  void initializeServiceFactory()
           
 boolean isStart()
          Whether or not the Server should be started upon creation.
 void setInvoker(org.apache.cxf.service.invoker.Invoker invoker)
           
 void setSchemaLocations(java.util.List<java.lang.String> schemaLocations)
           
 void setServer(org.apache.cxf.endpoint.Server server)
           
 void setServiceBean(java.lang.Object serviceBean)
          Set the backing service bean.
 void setStart(boolean start)
           
 
Methods inherited from class org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory
createBindingInfo, createEndpoint, createEndpointInfo, getServiceClass, getServiceFactory, getWsdlURL, initializeAnnotationInterceptors, initializeAnnotationInterceptors, setServiceClass, setServiceFactory, setWsdlURL
 
Methods inherited from class org.apache.cxf.endpoint.AbstractEndpointFactory
getAddress, getBindingConfig, getBindingFactory, getBindingId, getBus, getConduitSelector, getDataBinding, getDestinationFactory, getEndpointName, getFeatures, getProperties, getPublishedEndpointUrl, getServiceName, getTransportId, setAddress, setBindingConfig, setBindingFactory, setBindingId, setBus, setConduitSelector, setDataBinding, setDestinationFactory, setEndpointName, setEndpointReference, setFeatures, setProperties, setPublishedEndpointUrl, setServiceName, setTransportId
 
Methods inherited from class org.apache.cxf.interceptor.AbstractBasicInterceptorProvider
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors, setInFaultInterceptors, setInInterceptors, setOutFaultInterceptors, setOutInterceptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerFactoryBean

public ServerFactoryBean()

ServerFactoryBean

public ServerFactoryBean(ReflectionServiceFactoryBean sbean)
Method Detail

getBeanName

public java.lang.String getBeanName()

create

public org.apache.cxf.endpoint.Server create()

initializeServiceFactory

protected void initializeServiceFactory()
Overrides:
initializeServiceFactory in class AbstractWSDLBasedEndpointFactory

applyFeatures

protected void applyFeatures()

applyExtraClass

protected void applyExtraClass()

createInvoker

protected org.apache.cxf.service.invoker.Invoker createInvoker()

getServer

public org.apache.cxf.endpoint.Server getServer()

setServer

public void setServer(org.apache.cxf.endpoint.Server server)

isStart

public boolean isStart()
Whether or not the Server should be started upon creation.

Returns:

setStart

public void setStart(boolean start)

getServiceBean

public java.lang.Object getServiceBean()

getServiceBeanClass

public java.lang.Class<?> getServiceBeanClass()

setServiceBean

public void setServiceBean(java.lang.Object serviceBean)
Set the backing service bean. If this is set a BeanInvoker is created for the provided bean.


getSchemaLocations

public java.util.List<java.lang.String> getSchemaLocations()

setSchemaLocations

public void setSchemaLocations(java.util.List<java.lang.String> schemaLocations)

getInvoker

public org.apache.cxf.service.invoker.Invoker getInvoker()

setInvoker

public void setInvoker(org.apache.cxf.service.invoker.Invoker invoker)


Apache CXF