|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.xfire.service.binding.ObjectServiceFactory
public class ObjectServiceFactory
Creates Services from java objects. This class is meant to be easily overridable so you can customize how your services are created.
Field Summary | |
---|---|
static java.lang.String |
CREATE_DEFAULT_BINDINGS
|
static java.lang.String |
PORT_NAME
|
static java.lang.String |
PORT_TYPE
|
static java.lang.String |
SCHEMAS
|
static java.lang.String |
SCOPE
|
static java.lang.String |
SOAP11_TRANSPORTS
|
static java.lang.String |
SOAP12_TRANSPORTS
|
static java.lang.String |
STYLE
|
static java.lang.String |
USE
|
Constructor Summary | |
---|---|
ObjectServiceFactory()
Initializes a new instance of the ObjectServiceFactory . |
|
ObjectServiceFactory(BindingProvider bp)
|
|
ObjectServiceFactory(TransportManager transportManager)
Initializes a new instance of the ObjectServiceFactory . |
|
ObjectServiceFactory(TransportManager transportManager,
BindingProvider provider)
Initializes a new instance of the ObjectServiceFactory with the given transport manager and type
mapping registry. |
Method Summary | |
---|---|
protected FaultInfo |
addFault(Service service,
OperationInfo op,
java.lang.Class exClass)
|
void |
addIgnoredMethods(java.lang.String className)
Ignore the specified class' declared methods. |
protected OperationInfo |
addOperation(Service endpoint,
java.lang.reflect.Method method,
java.lang.String style)
|
void |
addSoap11Transport(java.lang.String id)
|
void |
addSoap12Transport(java.lang.String id)
|
protected void |
configureHeaders(Service service,
OperationInfo op,
Binding b)
|
Service |
create(java.lang.Class clazz)
Creates a service from the specified class. |
Service |
create(java.lang.Class clazz,
java.util.Map properties)
Creates a service from the specified class. |
Service |
create(java.lang.Class clazz,
javax.xml.namespace.QName name,
javax.wsdl.Definition def,
java.util.Map properties)
Create a service from a WSDL file. |
Service |
create(java.lang.Class clazz,
javax.xml.namespace.QName name,
javax.wsdl.Definition def,
java.util.Map properties,
WSDLWriter writer)
|
Service |
create(java.lang.Class clazz,
javax.xml.namespace.QName name,
java.net.URL wsdlUrl,
java.util.Map properties)
Creates a service via create(Class) . |
Service |
create(java.lang.Class clazz,
java.lang.String name,
java.lang.String namespace,
java.util.Map properties)
Creates a service from the specified class, soap version, style and use. |
protected void |
createBindingOperation(Service service,
AbstractSoapBinding binding,
OperationInfo op)
|
protected void |
createBindings(Service service,
java.util.Collection s11,
java.util.Collection s12)
|
protected void |
createDocumentationProvider(ServiceInfo serviceInfo)
|
Endpoint |
createEndpoint(Service service,
javax.xml.namespace.QName name,
java.lang.String url,
Binding binding)
Creates an endpoint for a service. |
protected javax.xml.namespace.QName |
createInputMessageName(OperationInfo op)
|
protected javax.xml.namespace.QName |
createOutputMessageName(OperationInfo op)
|
Soap11Binding |
createSoap11Binding(Service service,
javax.xml.namespace.QName bindingName,
java.lang.String bindingId)
Create a SOAP 1.1 binding for the specified binding id. |
Soap12Binding |
createSoap12Binding(Service service,
javax.xml.namespace.QName bindingName,
java.lang.String bindingId)
Create a SOAP 1.2 binding for the specified binding id. |
protected void |
createSoapBinding(Service service,
AbstractSoapBinding binding)
|
protected java.lang.String |
getAction(OperationInfo op)
|
BindingProvider |
getBindingProvider()
|
java.util.Map |
getCustomTypesMapping()
|
protected DocumentationProvider |
getDocumentationProvider()
|
protected javax.xml.namespace.QName |
getFaultName(Service service,
OperationInfo o,
java.lang.Class exClass,
java.lang.Class beanClass)
|
java.util.Set |
getIgnoredClasses()
|
protected javax.xml.namespace.QName |
getInParameterName(Service service,
OperationInfo op,
java.lang.reflect.Method method,
int paramNumber,
boolean doc)
|
protected java.lang.String |
getMEP(java.lang.reflect.Method method)
|
protected java.lang.String |
getOperationName(ServiceInfo service,
java.lang.reflect.Method method)
Creates a name for the operation from the method name. |
protected javax.xml.namespace.QName |
getOutParameterName(Service service,
OperationInfo op,
java.lang.reflect.Method method,
int paramNumber,
boolean doc)
|
protected MessageSerializer |
getSerializer(AbstractSoapBinding binding)
|
java.util.List |
getServiceConfigurations()
|
java.util.Collection |
getSoap11Transports()
Get a list of Transports which are enabled over SOAP 1.1. |
java.util.Collection |
getSoap12Transports()
Get a list of Transports which are enabled over SOAP 1.2. |
java.lang.String |
getStyle()
|
protected java.lang.String |
getTargetNamespace(java.lang.Class clazz)
|
TransportManager |
getTransportManager()
|
java.lang.String |
getUse()
|
WSDLBuilderFactory |
getWsdlBuilderFactory()
|
protected boolean |
hasOutMessage(java.lang.String mep)
|
protected void |
initializeFaults(Service service,
OperationInfo op)
|
protected void |
initializeOperations(Service endpoint,
java.lang.String style)
|
protected boolean |
isAsync(java.lang.reflect.Method method)
|
boolean |
isBindingCreationEnabled()
|
boolean |
isCustomFaultsEnabled()
|
protected boolean |
isFaultInfoClass(java.lang.Class exClass)
|
protected boolean |
isHeader(java.lang.reflect.Method method,
int j)
|
protected boolean |
isInParam(java.lang.reflect.Method method,
int j)
|
protected boolean |
isOutParam(java.lang.reflect.Method method,
int j)
|
protected boolean |
isValidMethod(java.lang.reflect.Method method)
|
boolean |
isVoidOneWay()
|
protected java.lang.String |
makeServiceNameFromClassName(java.lang.Class clazz)
|
protected void |
registerHandlers(Service service)
|
void |
setBindingCreationEnabled(boolean bindingCreationEnabled)
|
void |
setBindingProvider(BindingProvider bindingProvider)
|
void |
setCustomFaultsEnabled(boolean customFaultsEnabled)
|
void |
setCustomTypesMapping(java.util.Map customTypesMapping)
|
protected void |
setDocumentationProvider(DocumentationProvider documentationProvider)
|
void |
setServiceConfigurations(java.util.List serviceConfigurations)
|
void |
setStyle(java.lang.String style)
|
void |
setTransportManager(TransportManager transportManager)
|
void |
setUse(java.lang.String use)
|
void |
setVoidOneWay(boolean voidOneWay)
|
void |
setWsdlBuilderFactory(WSDLBuilderFactory wsdlBuilderFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PORT_TYPE
public static final java.lang.String PORT_NAME
public static final java.lang.String STYLE
public static final java.lang.String USE
public static final java.lang.String CREATE_DEFAULT_BINDINGS
public static final java.lang.String SOAP11_TRANSPORTS
public static final java.lang.String SOAP12_TRANSPORTS
public static final java.lang.String SCOPE
public static final java.lang.String SCHEMAS
Constructor Detail |
---|
public ObjectServiceFactory()
ObjectServiceFactory
.
Uses the XFireFactory to obtain an instance of the TransportManager.
public ObjectServiceFactory(TransportManager transportManager, BindingProvider provider)
ObjectServiceFactory
with the given transport manager and type
mapping registry.
transportManager
- the transport managerprovider
- the binding providerpublic ObjectServiceFactory(TransportManager transportManager)
ObjectServiceFactory
.
public ObjectServiceFactory(BindingProvider bp)
Method Detail |
---|
public java.util.Map getCustomTypesMapping()
public void setCustomTypesMapping(java.util.Map customTypesMapping)
public BindingProvider getBindingProvider()
public Service create(java.lang.Class clazz, javax.xml.namespace.QName name, java.net.URL wsdlUrl, java.util.Map properties)
create(Class)
. It then configures
the bindings and endpoints on the service via the WSDL.
create
in interface ServiceFactory
clazz
- The service class for the wsdl.wsdlUrl
- The WSDL URL.
public Service create(java.lang.Class clazz, javax.xml.namespace.QName name, javax.wsdl.Definition def, java.util.Map properties)
ServiceFactory
create
in interface ServiceFactory
clazz
- The service class for the wsdl.def
- The WSDL definition.
public Service create(java.lang.Class clazz, javax.xml.namespace.QName name, javax.wsdl.Definition def, java.util.Map properties, WSDLWriter writer)
protected void configureHeaders(Service service, OperationInfo op, Binding b)
public Service create(java.lang.Class clazz)
create
in interface ServiceFactory
clazz
- The service class used to populate the operations and
parameters. If the class is an interface, then the
implementation class that implements that interface must be
set via AbstractContext.setProperty(String, Object)
with the
property key being
ObjectInvoker.SERVICE_IMPL_CLASS
public Service create(java.lang.Class clazz, java.util.Map properties)
create
in interface ServiceFactory
clazz
- The service class used to populate the operations and
parameters. If the class is an interface, then the
implementation class that implements that interface must be
set via AbstractContext.setProperty(String, Object)
with the
property key being
ObjectInvoker.SERVICE_IMPL_CLASS
properties
- Properties to set on the service and use in construction.
protected java.lang.String makeServiceNameFromClassName(java.lang.Class clazz)
public Service create(java.lang.Class clazz, java.lang.String name, java.lang.String namespace, java.util.Map properties)
null
, and will be replaced with sensible defaults if so. See the specific
parameters for more info.
create
in interface ServiceFactory
clazz
- The service class used to populate the operations and parameters.name
- The name of the service. If null
, a name will be generated from the class
name.namespace
- The default namespace of the service. If null
, a namespace will be generated
from the class package.properties
- Service specific properties which the ServiceFactory will use
to create the service.
protected void createDocumentationProvider(ServiceInfo serviceInfo)
serviceInfo
- protected java.lang.String getTargetNamespace(java.lang.Class clazz)
public java.util.Collection getSoap11Transports()
public void addSoap11Transport(java.lang.String id)
public java.util.Collection getSoap12Transports()
public void addSoap12Transport(java.lang.String id)
protected void createBindings(Service service, java.util.Collection s11, java.util.Collection s12)
public Endpoint createEndpoint(Service service, javax.xml.namespace.QName name, java.lang.String url, Binding binding) throws java.lang.Exception
service
- name
- url
- binding
-
java.lang.Exception
public Soap12Binding createSoap12Binding(Service service, javax.xml.namespace.QName bindingName, java.lang.String bindingId)
service
- bindingName
- The name of the binding. If null, one will be created.bindingId
-
public Soap11Binding createSoap11Binding(Service service, javax.xml.namespace.QName bindingName, java.lang.String bindingId)
service
- bindingName
- The name of the binding. If null, one will be created.bindingId
-
protected void createSoapBinding(Service service, AbstractSoapBinding binding)
protected MessageSerializer getSerializer(AbstractSoapBinding binding)
protected void createBindingOperation(Service service, AbstractSoapBinding binding, OperationInfo op)
protected void registerHandlers(Service service)
protected void initializeOperations(Service endpoint, java.lang.String style)
public void addIgnoredMethods(java.lang.String className)
java.lang.Object
org.omg.CORBA_2_3.portable.ObjectImpl
org.omg.CORBA.portable.ObjectImpl
javax.ejb.EJBObject
javax.ejb.EJBLocalObject
javax.rmi.CORBA.Stub
className
- the fully qualified class nameprotected boolean isValidMethod(java.lang.reflect.Method method)
protected OperationInfo addOperation(Service endpoint, java.lang.reflect.Method method, java.lang.String style)
protected boolean isOutParam(java.lang.reflect.Method method, int j)
protected boolean isInParam(java.lang.reflect.Method method, int j)
protected javax.xml.namespace.QName createInputMessageName(OperationInfo op)
protected javax.xml.namespace.QName createOutputMessageName(OperationInfo op)
protected boolean hasOutMessage(java.lang.String mep)
protected void initializeFaults(Service service, OperationInfo op)
protected FaultInfo addFault(Service service, OperationInfo op, java.lang.Class exClass)
protected boolean isFaultInfoClass(java.lang.Class exClass)
protected javax.xml.namespace.QName getFaultName(Service service, OperationInfo o, java.lang.Class exClass, java.lang.Class beanClass)
protected java.lang.String getAction(OperationInfo op)
protected boolean isHeader(java.lang.reflect.Method method, int j)
protected java.lang.String getOperationName(ServiceInfo service, java.lang.reflect.Method method)
doSomething
, the first one will have an operation name of
"doSomething" and the second "doSomething1".
service
- method
- protected java.lang.String getMEP(java.lang.reflect.Method method)
protected boolean isAsync(java.lang.reflect.Method method)
protected javax.xml.namespace.QName getInParameterName(Service service, OperationInfo op, java.lang.reflect.Method method, int paramNumber, boolean doc)
protected javax.xml.namespace.QName getOutParameterName(Service service, OperationInfo op, java.lang.reflect.Method method, int paramNumber, boolean doc)
public TransportManager getTransportManager()
public void setTransportManager(TransportManager transportManager)
public void setBindingProvider(BindingProvider bindingProvider)
public java.lang.String getStyle()
public void setStyle(java.lang.String style)
public java.lang.String getUse()
public void setUse(java.lang.String use)
public boolean isVoidOneWay()
public void setVoidOneWay(boolean voidOneWay)
public WSDLBuilderFactory getWsdlBuilderFactory()
public void setWsdlBuilderFactory(WSDLBuilderFactory wsdlBuilderFactory)
public boolean isCustomFaultsEnabled()
public void setCustomFaultsEnabled(boolean customFaultsEnabled)
public boolean isBindingCreationEnabled()
public void setBindingCreationEnabled(boolean bindingCreationEnabled)
public java.util.Set getIgnoredClasses()
public java.util.List getServiceConfigurations()
public void setServiceConfigurations(java.util.List serviceConfigurations)
protected DocumentationProvider getDocumentationProvider()
protected void setDocumentationProvider(DocumentationProvider documentationProvider)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |