public class DefaultServiceFactory extends Object implements ServiceFactory
ServiceFactory
implementation.ModelContext.createServiceObjects(java.lang.String, java.lang.String, java.lang.Class)
Constructor and Description |
---|
DefaultServiceFactory()
Creates a new
DefaultServiceFactory instance. |
Modifier and Type | Method and Description |
---|---|
<T> T |
createServiceObject(ModelContext context,
Service service,
Class<T> type)
Creates a new service object.
|
static int |
getDefaultOrdinal()
Gets the default ordinal number of the factory.
|
int |
getOrdinal()
Gets the ordinal number of the factory.
|
static void |
setDefaultOrdinal(Integer value)
Sets the default ordinal number of the factory.
|
void |
setOrdinal(Integer value)
Sets the ordinal number of the factory.
|
public DefaultServiceFactory()
DefaultServiceFactory
instance.public static int getDefaultOrdinal()
The default ordinal number is controlled by system property
org.jomc.modlet.DefaultServiceFactory.defaultOrdinal
holding the default ordinal number of the
factory. If that property is not set, the 0
default is returned.
setDefaultOrdinal(java.lang.Integer)
public static void setDefaultOrdinal(Integer value)
value
- The new default ordinal number of the factory or null
.getDefaultOrdinal()
public final int getOrdinal()
getOrdinal
in interface ServiceFactory
getDefaultOrdinal()
,
setOrdinal(java.lang.Integer)
public final void setOrdinal(Integer value)
value
- The new ordinal number of the factory or null
.getOrdinal()
public <T> T createServiceObject(ModelContext context, Service service, Class<T> type) throws ModelException
ServiceFactory
createServiceObject
in interface ServiceFactory
T
- The type of the service object.context
- The context to create a new service object with.service
- The service to create a new object of.type
- The class of the type of the service object.service
or null
, if the factory is not responsible for creating
service objects of type
.ModelException
- if creating the service object fails.Copyright © 2005–2016 The JOMC Project. All rights reserved.