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 inherited from interface org.compiere.server.IServerManager
SERVER_STATE_NOT_SCHEDULE, SERVER_STATE_STARTED, SERVER_STATE_STOPPED
-
Method Summary
Modifier and TypeMethodDescriptionaddingService
(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer, AdempiereProcessor>> reference) 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[]
Get Active ServersgetCtx()
Get Server ContextGet Descriptionprotected org.compiere.server.AdempiereServerMgr.LocalServerController[]
Get InActive ServersGet Number ServersgetServerInstance
(String serverID) Get Server with IDGet start dateint
getStatus
(AdempiereProcessor processor) void
modifiedService
(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer, AdempiereProcessor>> reference, IServerFactory<AdempiereServer, AdempiereProcessor> service) reload()
Start Environmentvoid
removedService
(org.osgi.framework.ServiceReference<IServerFactory<AdempiereServer, AdempiereProcessor>> reference, IServerFactory<AdempiereServer, AdempiereProcessor> service) removeScheduler
(MScheduler scheduler) Start Server if not started yetstartAll()
Start all serversStop Server if not stoppedstopAll()
Stop all ServerstoString()
String RepresentationMethods 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 Details
-
log
Logger
-
-
Method Details
-
get
Get Adempiere Server Manager- Returns:
- mgr
-
get
Get Adempiere Server Manager- Returns:
- mgr
-
reload
Start Environment- Specified by:
reload
in interfaceIServerManager
- Returns:
- true if started
-
addScheduler
- Specified by:
addScheduler
in interfaceIServerManager
- Parameters:
scheduler
-- Returns:
- error
-
removeScheduler
- Specified by:
removeScheduler
in interfaceIServerManager
- Returns:
- error
-
getCtx
Get Server Context- Returns:
- ctx
-
startAll
Start all servers- Specified by:
startAll
in interfaceIServerManager
- Returns:
- true if started
-
start
Start Server if not started yet- Specified by:
start
in interfaceIServerManager
- Parameters:
serverID
- server ID- Returns:
- true if started
-
stopAll
Stop all Servers- Specified by:
stopAll
in interfaceIServerManager
- Returns:
- true if stopped
-
stop
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
- Specified by:
getServerInstances
in interfaceIServerManager
- Returns:
- all server instances
-
getStatus
-
getServerInstance
Get Server with ID- Specified by:
getServerInstance
in interfaceIServerManager
- Parameters:
serverID
- server id- Returns:
- server or null
-
toString
String Representation -
getDescription
Get Description- Specified by:
getDescription
in interfaceIServerManager
- Returns:
- description
-
getServerCount
Get Number Servers- Specified by:
getServerCount
in interfaceIServerManager
- Returns:
- no of servers
-
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
-
remove
-
runNow
- Specified by:
runNow
in interfaceIServerManager
- Returns:
- error
-