public class BasicService extends Object implements IInternalService
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_LOCAL
Constant for local default timeout.
|
static long |
DEFAULT_REMOTE
Constant for remote default timeout.
|
EMPTY_SERVICES
Constructor and Description |
---|
BasicService(IComponentIdentifier providerid,
Class<?> type,
Map<String,Object> properties)
Create a new service.
|
Modifier and Type | Method and Description |
---|---|
static IServiceIdentifier |
createServiceIdentifier(IComponentIdentifier providerid,
String servicename,
Class<?> servicetype,
Class<?> serviceimpl,
IResourceIdentifier rid)
Create a new service identifier.
|
void |
createServiceIdentifier(String name,
Class<?> implclazz,
IResourceIdentifier rid,
Class<?> type)
Set the service identifier.
|
boolean |
equals(Object obj)
Check if the service is equal.
|
static String |
generateServiceName(Class<?> service)
Generate a unique name.
|
Map<String,Object> |
getPropertyMap()
Get a service property.
|
IComponentIdentifier |
getProviderId()
Get the providerid.
|
IServiceIdentifier |
getServiceIdentifier()
Get the service id.
|
IFuture<Boolean> |
isValid()
Test if the service is valid.
|
void |
setPropertyMap(Map<String,Object> properties)
Set the properties.
|
IFuture<Void> |
shutdownService()
Shutdown the service.
|
IFuture<Void> |
startService()
Start the service.
|
public static long DEFAULT_REMOTE
public static long DEFAULT_LOCAL
public BasicService(IComponentIdentifier providerid, Class<?> type, Map<String,Object> properties)
public void createServiceIdentifier(String name, Class<?> implclazz, IResourceIdentifier rid, Class<?> type)
createServiceIdentifier
in interface IInternalService
public IServiceIdentifier getServiceIdentifier()
getServiceIdentifier
in interface IService
public IComponentIdentifier getProviderId()
public Map<String,Object> getPropertyMap()
getPropertyMap
in interface IService
public void setPropertyMap(Map<String,Object> properties)
properties
- The properties to set.public IFuture<Void> startService()
startService
in interface IInternalService
public IFuture<Void> shutdownService()
shutdownService
in interface IInternalService
public static String generateServiceName(Class<?> service)
The
- calling service class.public static IServiceIdentifier createServiceIdentifier(IComponentIdentifier providerid, String servicename, Class<?> servicetype, Class<?> serviceimpl, IResourceIdentifier rid)
providerid
- The provider id.servicename
- The service name.Copyright © 2012. All Rights Reserved.