public final class Agent
extends Object
Used to register a ServiceActivator
with a MBeanServer
.
Also used to export an AgentSessionFactory
bound to the RMI
registry under the name of a ServiceActivator
.
Implemented as a singleton, it will be shared by ServiceActivator
s
running together.
Modifier and Type | Field and Description |
---|---|
static String |
JMX_PROPERTIES
JMX properties.
|
static String |
PASSWORD_PROPERTY
Login password property.
|
static String |
PLATFORM_PROPERTY
Platform property.
|
static String |
REGISTRATION_ENABLED_PROPERTY
Enables automatic registration of standalone services.
|
static String |
REGISTRY_PREFIX
The prefix used for registry names.
|
static String |
ROLE_CONNECT_PROPERTY
The role needed for connection to the agent.
|
static String |
USER_PROPERTY
Login user property.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exportService(ServiceActivator serviceActivator)
Exports the
AgentSessionFactory under the name of a service. |
static Agent |
getInstance()
Gets the singleton instance.
|
static LoginInfo |
getLoginInfo(Config config)
Gets login informations.
|
static boolean |
isRegistrationEnabled(Config config)
Asks if automatic registration of standalone services is enabled.
|
boolean |
registerService(ServiceActivator serviceActivator)
Registers a service.
|
boolean |
registerStatsHolder(StatsHolder statsHolder)
Registers a stats holder.
|
boolean |
setUp(Config config)
Sets up the agent.
|
void |
tearDown(Config config)
Tears down what has been set up.
|
void |
unexportService(ServiceActivator serviceActivator)
Unexports a service.
|
void |
unregisterService(ServiceActivator serviceActivator)
Unregisters a service.
|
void |
unregisterStatsHolder(StatsHolder statsHolder)
Unregisters a stats holder.
|
public static final String JMX_PROPERTIES
public static final String PASSWORD_PROPERTY
public static final String PLATFORM_PROPERTY
public static final String REGISTRATION_ENABLED_PROPERTY
public static final String REGISTRY_PREFIX
public static final String ROLE_CONNECT_PROPERTY
public static final String USER_PROPERTY
@Nonnull @CheckReturnValue public static Agent getInstance()
@Nonnull @CheckReturnValue public static LoginInfo getLoginInfo(@Nonnull Config config)
config
- The configuration.@CheckReturnValue public static boolean isRegistrationEnabled(@Nonnull Config config)
config
- The config.@CheckReturnValue public boolean exportService(@Nonnull ServiceActivator serviceActivator)
AgentSessionFactory
under the name of a service.serviceActivator
- The service activator.@CheckReturnValue public boolean registerService(@Nonnull ServiceActivator serviceActivator)
serviceActivator
- The service activator.@CheckReturnValue public boolean registerStatsHolder(@Nonnull StatsHolder statsHolder)
statsHolder
- The stats holder.@CheckReturnValue public boolean setUp(@Nonnull Config config)
The first call will perform the initializations. Further calls will be ignored.
config
- The config.public void tearDown(@Nonnull Config config)
Calls with a config other than the one used on the first call to
setUp(org.rvpf.config.Config)
will be ignored.
config
- The config that was passed to setUp(org.rvpf.config.Config)
.public void unexportService(@Nonnull ServiceActivator serviceActivator)
serviceActivator
- The service activator.public void unregisterService(@Nonnull ServiceActivator serviceActivator)
serviceActivator
- The service activator.public void unregisterStatsHolder(@Nonnull StatsHolder statsHolder)
statsHolder
- The stats holder.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.