Package org.compiere.server
Class AdempiereServerMgr
- java.lang.Object
-
- org.compiere.server.AdempiereServerMgr
-
- All Implemented Interfaces:
EventListener
,IServerManager
,org.osgi.framework.BundleListener
,org.osgi.util.tracker.ServiceTrackerCustomizer<IServerFactory<AdempiereServer,AdempiereProcessor>,IServerFactory<AdempiereServer,AdempiereProcessor>>
public class AdempiereServerMgr extends Object implements org.osgi.util.tracker.ServiceTrackerCustomizer<IServerFactory<AdempiereServer,AdempiereProcessor>,IServerFactory<AdempiereServer,AdempiereProcessor>>, org.osgi.framework.BundleListener, IServerManager
Adempiere Server Manager- Version:
- $Id: AdempiereServerMgr.java,v 1.4 2006/10/09 00:23:26 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description protected static CLogger
log
Logger-
Fields inherited from interface org.compiere.server.IServerManager
SERVER_STATE_NOT_SCHEDULE, SERVER_STATE_STARTED, SERVER_STATE_STOPPED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IServerFactory<AdempiereServer,AdempiereProcessor>
addingService(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer,AdempiereProcessor>> reference)
String
addScheduler(MScheduler scheduler)
void
bundleChanged(org.osgi.framework.BundleEvent event)
void
destroy()
Destroystatic AdempiereServerMgr
get()
Get Adempiere Server Managerstatic AdempiereServerMgr
get(boolean createNew)
Get Adempiere Server Managerprotected org.compiere.server.AdempiereServerMgr.LocalServerController[]
getActive()
Get Active ServersProperties
getCtx()
Get Server ContextString
getDescription()
Get Descriptionprotected org.compiere.server.AdempiereServerMgr.LocalServerController[]
getInActive()
Get InActive ServersServerCount
getServerCount()
Get Number ServersServerInstance
getServerInstance(String serverID)
Get Server with IDServerInstance[]
getServerInstances()
Timestamp
getStartTime()
Get start dateint
getStatus(AdempiereProcessor processor)
void
modifiedService(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer,AdempiereProcessor>> reference, IServerFactory<AdempiereServer,AdempiereProcessor> service)
String
reload()
Start EnvironmentBoolean
remove(String serverID)
void
removedService(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer,AdempiereProcessor>> reference, IServerFactory<AdempiereServer,AdempiereProcessor> service)
String
removeScheduler(MScheduler scheduler)
String
runNow(String serverId)
String
start(String serverID)
Start Server if not started yetString
startAll()
Start all serversString
stop(String serverID)
Stop Server if not stoppedString
stopAll()
Stop all ServersString
toString()
String Representation-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.compiere.server.IServerManager
getServerStatus
-
-
-
-
Field Detail
-
log
protected static final CLogger log
Logger
-
-
Method Detail
-
get
public static AdempiereServerMgr get()
Get Adempiere Server Manager- Returns:
- mgr
-
get
public static AdempiereServerMgr get(boolean createNew)
Get Adempiere Server Manager- Returns:
- mgr
-
reload
public String reload()
Start Environment- Specified by:
reload
in interfaceIServerManager
- Returns:
- true if started
-
addScheduler
public String addScheduler(MScheduler scheduler)
- Specified by:
addScheduler
in interfaceIServerManager
- Parameters:
scheduler
-- Returns:
- error
-
removeScheduler
public String removeScheduler(MScheduler scheduler)
- Specified by:
removeScheduler
in interfaceIServerManager
- Returns:
- error
-
getCtx
public Properties getCtx()
Get Server Context- Returns:
- ctx
-
startAll
public String startAll()
Start all servers- Specified by:
startAll
in interfaceIServerManager
- Returns:
- true if started
-
start
public String start(String serverID)
Start Server if not started yet- Specified by:
start
in interfaceIServerManager
- Parameters:
serverID
- server ID- Returns:
- true if started
-
stopAll
public String stopAll()
Stop all Servers- Specified by:
stopAll
in interfaceIServerManager
- Returns:
- true if stopped
-
stop
public String stop(String serverID)
Stop Server if not stopped- Specified by:
stop
in interfaceIServerManager
- Parameters:
serverID
- server ID- Returns:
- true if interrupted
-
destroy
public void destroy()
Destroy
-
getActive
protected org.compiere.server.AdempiereServerMgr.LocalServerController[] getActive()
Get Active Servers- Returns:
- array of active servers
-
getInActive
protected org.compiere.server.AdempiereServerMgr.LocalServerController[] getInActive()
Get InActive Servers- Returns:
- array of inactive servers
-
getServerInstances
public ServerInstance[] getServerInstances()
- Specified by:
getServerInstances
in interfaceIServerManager
- Returns:
- all server instances
-
getStatus
public int getStatus(AdempiereProcessor processor)
-
getServerInstance
public ServerInstance getServerInstance(String serverID)
Get Server with ID- Specified by:
getServerInstance
in interfaceIServerManager
- Parameters:
serverID
- server id- Returns:
- server or null
-
toString
public String toString()
String Representation
-
getDescription
public String getDescription()
Get Description- Specified by:
getDescription
in interfaceIServerManager
- Returns:
- description
-
getServerCount
public ServerCount getServerCount()
Get Number Servers- Specified by:
getServerCount
in interfaceIServerManager
- Returns:
- no of servers
-
getStartTime
public Timestamp getStartTime()
Get start date- Specified by:
getStartTime
in interfaceIServerManager
- Returns:
- start date
-
addingService
public IServerFactory<AdempiereServer,AdempiereProcessor> addingService(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer,AdempiereProcessor>> reference)
- Specified by:
addingService
in interfaceorg.osgi.util.tracker.ServiceTrackerCustomizer<IServerFactory<AdempiereServer,AdempiereProcessor>,IServerFactory<AdempiereServer,AdempiereProcessor>>
-
modifiedService
public void modifiedService(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer,AdempiereProcessor>> reference, IServerFactory<AdempiereServer,AdempiereProcessor> service)
- Specified by:
modifiedService
in interfaceorg.osgi.util.tracker.ServiceTrackerCustomizer<IServerFactory<AdempiereServer,AdempiereProcessor>,IServerFactory<AdempiereServer,AdempiereProcessor>>
-
removedService
public void removedService(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer,AdempiereProcessor>> reference, IServerFactory<AdempiereServer,AdempiereProcessor> service)
- Specified by:
removedService
in interfaceorg.osgi.util.tracker.ServiceTrackerCustomizer<IServerFactory<AdempiereServer,AdempiereProcessor>,IServerFactory<AdempiereServer,AdempiereProcessor>>
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChanged
in interfaceorg.osgi.framework.BundleListener
-
runNow
public String runNow(String serverId)
- Specified by:
runNow
in interfaceIServerManager
- Returns:
- error
-
-