|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.odata4j.producer.resources.DefaultODataProducerProvider
@Provider public class DefaultODataProducerProvider
Default OData producer provider.
OData producer instances can either be set statically (method setInstance
)
or created by a factory (ODataProducerFactory
) specified by the corresponding
system property (constant FACTORY_PROPNAME
).
To introduce an additional container-specific setting, it is required to extend
this class and override method createInstanceFromFactoryInContainerSpecificSetting
.
Furthermore a subclass of AbstractODataApplication
has to be created to make
the new provider available to the JAX-RS runtime.
Field Summary | |
---|---|
static String |
FACTORY_PROPNAME
Constant used as system property name. |
Constructor Summary | |
---|---|
DefaultODataProducerProvider()
|
Method Summary | |
---|---|
protected ODataProducer |
createInstanceFromFactoryInContainerSpecificSetting()
Creates an OData producer instance using a factory specified in a container-specific setting. |
ODataProducer |
getContext(Class<?> type)
|
protected void |
log(String msg)
Helper method to log an INFO message. |
protected ODataProducer |
newProducerFromFactory(String factoryTypeName,
Properties props)
Helper method to create an OData producer instance from a given producer factory ( ODataProducerFactory ). |
static void |
setInstance(ODataProducer producer)
Sets the given OData producer as a static singleton. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FACTORY_PROPNAME
Constructor Detail |
---|
public DefaultODataProducerProvider()
Method Detail |
---|
protected ODataProducer createInstanceFromFactoryInContainerSpecificSetting()
The default implementation returns null
. Implementers can use the helper
methods newProducerFromFactory
and log
.
null
if no container-specific setting existspublic final ODataProducer getContext(Class<?> type)
getContext
in interface ContextResolver<ODataProducer>
protected final void log(String msg)
msg
- the log messageprotected final ODataProducer newProducerFromFactory(String factoryTypeName, Properties props)
ODataProducerFactory
).
factoryTypeName
- the factory's type name (fully qualified)props
- the properties to use when constructing the producer
public static void setInstance(ODataProducer producer)
producer
- the OData producer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |