class Activation extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
(package private) class |
Activation.ActivatorImpl |
private static class |
Activation.ActLogHandler
Handler for the log that knows how to take the initial snapshot
and apply an update (a LogRecord) to the current state.
|
private class |
Activation.GroupEntry
Container for group information: group's descriptor, group's
instantiator, flag to indicate pending group creation, and
table of the group's active objects.
|
private static class |
Activation.LogGroupIncarnation
Log record for an active group incarnation
|
private static class |
Activation.LogRecord
Abstract class for all log records.
|
private static class |
Activation.LogRegisterGroup
Log record for registering a group.
|
private static class |
Activation.LogRegisterObject
Log record for registering an object.
|
private static class |
Activation.LogUnregisterGroup
Log record for unregistering a group.
|
private static class |
Activation.LogUnregisterObject
Log record for unregistering an object.
|
private static class |
Activation.LogUpdateDesc
Log record for updating an activation desc
|
private static class |
Activation.LogUpdateGroupDesc
Log record for unregistering a group.
|
(package private) class |
Activation.MonitorImpl |
private class |
Activation.ObjectEntry |
(package private) class |
Activation.RegistryImpl
A read-only registry containing a single entry for the system.
|
private class |
Activation.Shutdown
Thread to shutdown phoenix.
|
private class |
Activation.ShutdownHook
Thread to destroy children in the event of abnormal termination.
|
(package private) class |
Activation.SystemImpl |
Modifier and Type | Field and Description |
---|---|
private Activator |
activator
ActivatorImpl instance
|
private Exporter |
activatorExporter
exporter for activator
|
private Activator |
activatorStub
stub for activator
|
private String[] |
command
the default java command for groups
|
private int |
groupCounter
counter for numbering groups
|
private MarshalledObject |
groupData
MarshalledObject(ActivationGroupData) or null
|
private String |
groupLocation
Location of ActivationGroupImpl or null
|
private ProxyPreparer |
groupPreparer
preparer for ActivationInstantiators
|
private int |
groupSemaphore
number of simultaneous group exec's
|
private Map |
groupTable
maps group id to its GroupEntry groups
|
private long |
groupTimeout
timeout on wait for child process to be created or destroyed
|
private Map |
idTable
maps activation id uid to its respective group id
|
private ReliableLog |
log
persistent store
|
private static Logger |
logger |
private LoginContext |
login
login context
|
private static Object |
logLock |
private ActivationMonitor |
monitor
MonitorImpl instance
|
private Exporter |
monitorExporter
exporter for monitor
|
private ActivationMonitor |
monitorStub
stub for monitor
|
private int |
numUpdates
number of log updates since last log snapshot
|
private GroupOutputHandler |
outputHandler |
private static String |
PHOENIX |
private static int |
PHOENIX_PORT |
private Registry |
registry
RegistryImpl instance
|
private Exporter |
registryExporter
exporter for registry
|
private Registry |
registryStub
stub for registry
|
private static ResourceBundle |
resources |
private static long |
serialVersionUID |
private Thread |
shutdownHook
Runtime shutdown hook
|
private boolean |
shuttingDown
true if shutdown has been called
|
private int |
snapshotInterval
take log snapshot after this many updates
|
private PhoenixStarter |
starter
Non-null if phoenix was started by the service starter
|
private ActivationSystem |
system
SystemImpl instance
|
private Exporter |
systemExporter
exporter for system
|
private ActivationSystem |
systemStub
stub for system
|
private long |
unexportTimeout
timeout on wait for unexport to succeed
|
private long |
unexportWait
timeout on wait between unexport attempts
|
Modifier | Constructor and Description |
---|---|
private |
Activation()
Create an uninitialized instance of Activation that can be
populated with log data.
|
Modifier and Type | Method and Description |
---|---|
private String[] |
activationArgs(ActivationGroupDesc desc) |
private void |
addLogRecord(Activation.LogRecord rec)
Adds a record to the activation log.
|
private static void |
bomb(String error) |
private static void |
bomb(String res,
String val) |
private void |
checkShutdown()
If shutting down, throw an ActivationException.
|
(package private) ActivationSystem |
getActivationSystemProxy()
Returns the ActivationSystem proxy (used by the PhoenixStarter).
|
private ActivationID |
getAID(UID uid) |
private static Configuration |
getConfig(String[] configOptions,
PhoenixStarter starter)
Return a configuration for the specified options.
|
private static String |
getDefaultGroupLocation() |
private static Exporter |
getExporter(Configuration config,
String name,
Exporter defaultExporter)
Return the exporter with the specified name from the specified
configuration.
|
private Activation.GroupEntry |
getGroupEntry(ActivationGroupID id)
Returns the group entry for the group id.
|
private Activation.GroupEntry |
getGroupEntry(UID uid)
Returns the group entry for the object's id.
|
private ActivationGroupID |
getGroupID(UID uid)
Returns the groupID for a given id of an object in the group.
|
private static int |
getInt(Configuration config,
String name,
int defValue)
Return an int configuration entry.
|
private static ProxyPreparer |
getPreparer(Configuration config,
String name)
Return a ProxyPreparer configuration entry.
|
(package private) static String |
getTextResource(String key)
Retrieves text resources from the locale-specific properties file.
|
private static UID |
getUID(ActivationID id) |
private void |
init(ReliableLog log,
LoginContext login,
Configuration config,
String[] configOptions,
PhoenixStarter starter) |
static void |
main(String[] args)
Starts phoenix.
|
(package private) static Activation |
main(String[] configOptions,
boolean stop,
PhoenixStarter starter)
Starts phoenix and returns a reference to the recovered
Activation instance. |
private String |
Pstartgroup()
Acquire the group semaphore and return a group name.
|
private static void |
shutdown(Configuration config)
Shut down an activation system daemon, using the specified
configuration location to obtain the host and port of the daemon's
registry, the client constraints for the remote call, and the
permissions to grant to the system proxy.
|
private void |
snapshot() |
private static void |
usage() |
private void |
Vstartgroup()
Release the group semaphore.
|
private static final long serialVersionUID
private static final String PHOENIX
private static ResourceBundle resources
private static Logger logger
private static final int PHOENIX_PORT
private static final Object logLock
private Map idTable
private Map groupTable
private transient LoginContext login
private transient int groupSemaphore
private transient int groupCounter
private transient ReliableLog log
private transient int numUpdates
private transient int snapshotInterval
private transient String[] command
private transient long groupTimeout
private transient long unexportTimeout
private transient long unexportWait
private transient Activator activator
private transient Exporter activatorExporter
private transient Activator activatorStub
private transient ActivationSystem system
private transient Exporter systemExporter
private transient ActivationSystem systemStub
private transient ActivationMonitor monitor
private transient Exporter monitorExporter
private transient ActivationMonitor monitorStub
private transient Registry registry
private transient Exporter registryExporter
private transient Registry registryStub
private transient MarshalledObject groupData
private transient String groupLocation
private transient ProxyPreparer groupPreparer
private transient GroupOutputHandler outputHandler
private volatile boolean shuttingDown
private transient Thread shutdownHook
private transient PhoenixStarter starter
private Activation()
private void init(ReliableLog log, LoginContext login, Configuration config, String[] configOptions, PhoenixStarter starter) throws Exception
Exception
private static String getDefaultGroupLocation()
private static Configuration getConfig(String[] configOptions, PhoenixStarter starter) throws ConfigurationException
ConfigurationException
private static int getInt(Configuration config, String name, int defValue) throws ConfigurationException
ConfigurationException
private static Exporter getExporter(Configuration config, String name, Exporter defaultExporter) throws ConfigurationException
ConfigurationException
private static ProxyPreparer getPreparer(Configuration config, String name) throws ConfigurationException
ConfigurationException
private void checkShutdown() throws ActivationException
ActivationException
private ActivationID getAID(UID uid)
private static UID getUID(ActivationID id) throws UnknownObjectException
UnknownObjectException
private ActivationGroupID getGroupID(UID uid) throws UnknownObjectException
UnknownObjectException
private Activation.GroupEntry getGroupEntry(ActivationGroupID id) throws UnknownGroupException
UnknownGroupException
private Activation.GroupEntry getGroupEntry(UID uid) throws UnknownObjectException
UnknownObjectException
private String[] activationArgs(ActivationGroupDesc desc)
private void addLogRecord(Activation.LogRecord rec) throws ActivationException
ActivationException
private void snapshot() throws ActivationException
ActivationException
private static void usage()
private static void bomb(String error)
public static void main(String[] args)
args
- command line optionsActivationSystem getActivationSystemProxy()
static Activation main(String[] configOptions, boolean stop, PhoenixStarter starter) throws Exception
Activation
instance.configOptions
- the configuration options for the configurationstop
- if true
, initiates shutdown of the
activation system on the "registryHost" and "registryPort" obtained
from the configurationstarter
- the PhoenixStarter
instance, or
null
Exception
private static void shutdown(Configuration config) throws Exception
Exception
static String getTextResource(String key)
private String Pstartgroup() throws ActivationException
N
other threads
holding the group semaphore. The calling thread will then acquire
the semaphore and return.ActivationException
private void Vstartgroup()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.