Package com.tangosol.net
Class DefaultCacheServer.GarServer
- java.lang.Object
 - 
- com.tangosol.util.Base
 - 
- com.tangosol.net.DefaultCacheServer
 - 
- com.tangosol.net.DefaultCacheServer.GarServer
 
 
 
 
- 
- Enclosing class:
 - DefaultCacheServer
 
public static class DefaultCacheServer.GarServer extends DefaultCacheServer
GarServer provides the functionality of DefaultCacheServer under the context of a GAR file. The GAR provided to an instance of GarServer can either be a GAR file complying to the GAR file structure or a directory containing contents complying to the same structure. In the former case the GAR file is extracted to a temporary directory and removed iff a graceful shutdown has occurred.- Since:
 - Coherence 12.1.2
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class com.tangosol.net.DefaultCacheServer
DefaultCacheServer.GarServer, DefaultCacheServer.LifecycleContext, DefaultCacheServer.SimpleContext 
- 
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected String[]f_asTenantAn array of tenant IDs.protected Filef_fileGarThe GAR file being deployed.protected Stringf_sAppNameThe name of the application.protected static StringGAR_DIR_PREFIXThe prefix used when generating a directory name to contain the exploded artifacts.protected ContainerAdapter[]m_aAdapterAn array of ContainerAdapters managed by this GarServer.protected Filem_dirGarExplodedThe directory the gar file was exploded to.- 
Fields inherited from class com.tangosol.net.DefaultCacheServer
DEFAULT_WAIT_MILLIS, m_fServicesStarted, m_fShutdown, m_listLifecycleListener, m_serviceMon, m_threadShutdown 
 - 
 
- 
Constructor Summary
Constructors Constructor Description GarServer(File fileGar)Construct a GarServer using the provided GAR file or directory containing the contents complying to the GAR structure.GarServer(File fileGar, String sAppName, String[] asTenant)Construct a GarServer using the provided GAR file or directory containing the contents complying to the GAR structure. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckExplodedDir()Check the number of exploded directories is not considerably more than the number of cluster members on this machine.voiddeactivate()List<ContainerAdapter>getContainers()Return the list ofContainerAdapters activated by this GarServer.protected voidinitialStartServices(long cWaitMillis)Set up any necessary resources including the extraction of a GAR file to a temporary location and the parsing of the GAR's descriptor, create and activate a ContainerAdapter.booleanisMonitorStopped()Return theServiceMonitorused by the cache server.voidshutdownServer()Shutdown the DefaultCacheServer and Coherence cluster.protected Map<Service,String>startServicesInternal()Starts the services marked with autostart returning a map of a service name to the started service.protected booleanstopMonitoring()Ensures the DCS instance has shutdown and the associated ServiceMonitor is no longer monitoring services.- 
Methods inherited from class com.tangosol.net.DefaultCacheServer
addLifecycleListener, ensureInstance, ensureInstance, ensureLifecycleListeners, getConfigurableCacheFactory, getInstance, getServiceBanner, handleEnsureServiceException, instantiateContext, isMonitoringServices, main, markServicesStarted, monitorServices, notifyShutdown, removeLifecycleListener, reportStarted, reportStarted, shutdown, start, start, startAndMonitor, startDaemon, startDaemon, startDaemon, startDaemon, startDaemon, startServerDaemon, startServerDaemon, startServerDaemon, startServerDaemon, startServerDaemon, startServices, stop, stopServiceMonitor, waitForServiceStart 
- 
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait 
 - 
 
 - 
 
- 
- 
Field Detail
- 
GAR_DIR_PREFIX
protected static final String GAR_DIR_PREFIX
The prefix used when generating a directory name to contain the exploded artifacts.- See Also:
 - Constant Field Values
 
 
- 
f_fileGar
protected final File f_fileGar
The GAR file being deployed. 
- 
f_sAppName
protected final String f_sAppName
The name of the application. 
- 
f_asTenant
protected final String[] f_asTenant
An array of tenant IDs. 
- 
m_aAdapter
protected ContainerAdapter[] m_aAdapter
An array of ContainerAdapters managed by this GarServer. 
- 
m_dirGarExploded
protected File m_dirGarExploded
The directory the gar file was exploded to. 
 - 
 
- 
Constructor Detail
- 
GarServer
public GarServer(File fileGar)
Construct a GarServer using the provided GAR file or directory containing the contents complying to the GAR structure.- Parameters:
 fileGar- file reference to either a GAR file or a directory containing the contents of the GAR
 
- 
GarServer
public GarServer(File fileGar, String sAppName, String[] asTenant)
Construct a GarServer using the provided GAR file or directory containing the contents complying to the GAR structure.- Parameters:
 fileGar- file reference to either a GAR file or a directory containing the contents of the GARsAppName- (optional) application nameasTenant- (optional) Domain Partition names
 
 - 
 
- 
Method Detail
- 
getContainers
public List<ContainerAdapter> getContainers()
Return the list ofContainerAdapters activated by this GarServer.- Returns:
 - the list of 
ContainerAdapters activated by this GarServer 
 
- 
initialStartServices
protected void initialStartServices(long cWaitMillis)
Set up any necessary resources including the extraction of a GAR file to a temporary location and the parsing of the GAR's descriptor, create and activate a ContainerAdapter.- Overrides:
 initialStartServicesin classDefaultCacheServer- Parameters:
 cWaitMillis- the interval, in milliseconds, to monitor services
 
- 
startServicesInternal
protected Map<Service,String> startServicesInternal()
Starts the services marked with autostart returning a map of a service name to the started service.- Overrides:
 startServicesInternalin classDefaultCacheServer- Returns:
 - a map holding all started services keyed by names
 
 
- 
stopMonitoring
protected boolean stopMonitoring()
Ensures the DCS instance has shutdown and the associated ServiceMonitor is no longer monitoring services. return true if the monitoring was active and has been stopped as a result of this call; false if the monitoring was not active- Overrides:
 stopMonitoringin classDefaultCacheServer
 
- 
shutdownServer
public void shutdownServer()
Shutdown the DefaultCacheServer and Coherence cluster.- Overrides:
 shutdownServerin classDefaultCacheServer
 
- 
deactivate
public void deactivate()
 
- 
isMonitorStopped
public boolean isMonitorStopped()
Return theServiceMonitorused by the cache server.- Overrides:
 isMonitorStoppedin classDefaultCacheServer- Returns:
 - the ServiceMonitor
 
 
- 
checkExplodedDir
protected void checkExplodedDir()
Check the number of exploded directories is not considerably more than the number of cluster members on this machine. If this is the case log a warning messaging. 
 - 
 
 -