public class SharedActivationGroupDescriptor extends Object implements ServiceDescriptor, Serializable
create
to register the activation system group with the activation system
This class, in conjunction with the ActivateWrapper
class,
creates an activation group suitable for hosting
multiple service objects, with each object
maintaining a distinct codebase and policy.
Modifier and Type | Field and Description |
---|---|
private String |
classpath |
private static String |
GROUP_COOKIE_FILE |
private String |
host |
private String |
log |
private static Logger |
logger |
private String |
policy |
private int |
port |
private static long |
serialVersionUID |
private String |
serverCommand |
private String[] |
serverOptions |
private Properties |
serverProperties |
Constructor and Description |
---|
SharedActivationGroupDescriptor(String policy,
String classpath,
String log,
String serverCommand,
String[] serverOptions,
String[] serverProperties)
Trivial constructor.
|
SharedActivationGroupDescriptor(String policy,
String classpath,
String log,
String serverCommand,
String[] serverOptions,
String[] serverProperties,
String host,
int port)
Trivial constructor.
|
Modifier and Type | Method and Description |
---|---|
private static Properties |
convertToProperties(String[] propertyValues) |
Object |
create(Configuration config)
Method that attempts to create a shared activation system group from the
description information provided via constructor parameters.
|
private static String[] |
customizeSharedGroupOptions(String classpath,
String[] userOptions) |
private static Properties |
customizeSharedGroupProperties(String policy,
Properties userProperties) |
String |
getActivationSystemHost()
Activation system host accessor method.
|
int |
getActivationSystemPort()
Activation system port accessor method.
|
String |
getClasspath()
Classpath accessor method.
|
String |
getLog()
Shared group log accessor method.
|
String |
getPolicy()
Policy accessor method.
|
String |
getServerCommand()
Command accessor method.
|
String[] |
getServerOptions()
Command options accessor method.
|
Properties |
getServerProperties()
Properties accessor method.
|
private void |
readObject(ObjectInputStream in)
Reads the default serializable field values for this object.
|
private void |
readObjectNoData()
Throws InvalidObjectException, since data for this class is required.
|
(package private) static ActivationGroupID |
restoreGroupID(String dir)
Utility method that restores the object stored in a well known file
under the provided
dir path. |
private static void |
storeGroupID(String dir,
ActivationGroupID obj)
Stores the
created object to a well known file
under the provided dir path. |
String |
toString() |
private static final long serialVersionUID
private final String policy
private final String classpath
private final String log
private final String serverCommand
private final String[] serverOptions
private final Properties serverProperties
private final String host
private final int port
private static final String GROUP_COOKIE_FILE
private static final Logger logger
public SharedActivationGroupDescriptor(String policy, String classpath, String log, String serverCommand, String[] serverOptions, String[] serverProperties)
host
and port
parameters set to
null
and 0, respectively.public SharedActivationGroupDescriptor(String policy, String classpath, String log, String serverCommand, String[] serverOptions, String[] serverProperties, String host, int port)
policy
- location of VM policy filename or URLclasspath
- location where shared VM
classes can be found. Classpath components must be separated
by path separators.log
- location where group identifier information will be persistedserverCommand
- VM command to useserverOptions
- array of command line options to pass on the VM's
command lineserverProperties
- array of property/value string pairs to
pass on the VMs command line (as in -D<property>=value). This
array must have an even number of elements.host
- hostname of desired activation system. If null
,
defaults to the localhost.port
- port of desired activation system. If value is <= 0, then
defaults to
ActivationSystem.SYSTEM_PORT
.public final String getPolicy()
public final String getClasspath()
public final String getLog()
public final String getServerCommand()
public final String[] getServerOptions()
public final Properties getServerProperties()
public final String getActivationSystemHost()
public final int getActivationSystemPort()
private static String[] customizeSharedGroupOptions(String classpath, String[] userOptions)
private static Properties convertToProperties(String[] propertyValues)
private static Properties customizeSharedGroupProperties(String policy, Properties userProperties)
public Object create(Configuration config) throws Exception
This method:
ActivationGroupDesc
with
the provided constructor parameter information
ActivationSystem.registerGroup()
with the constructed
ActivationGroupDesc
activation group identifier
to the shared group log.
ActivationSystem.unregisterGroup()
if an exception occurs while persisting the
ActivationGroupID
.
"java.security.policy"
property with the provided
policy setting to server properties.
create
in interface ServiceDescriptor
config
- The Configuration
object
used to configure the creation of the returned object.ActivationGroupID
for the newly
created activation system group instance.Exception
- Thrown if there was any problem
creating the object.private static void storeGroupID(String dir, ActivationGroupID obj) throws IOException
created
object to a well known file
under the provided dir
path.IOException
static ActivationGroupID restoreGroupID(String dir) throws IOException, ClassNotFoundException
dir
path.IOException
ClassNotFoundException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObjectNoData() throws ObjectStreamException
ObjectStreamException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.