public class NcsMain extends Object implements Runnable, NcsMainMBean, Thread.UncaughtExceptionHandler
NcsJVMLauncher
which contains a main() method.
It is however possible to embed and start the NcsMain thread from any
other java program by inserting the following code snippet:
NcsMain ncs = NcsMain.getInstance(host, port); Thread ncsThread = new Thread(ncs); ncsThread.start();The Ncs java vm main thread will connect to the Ncs Server and start negotiation of which packages/components that should be instantiated registered and started. No manual registration is necessary.
Modifier and Type | Field and Description |
---|---|
static String |
TAILF_CLASSLOADER
This field represents a system property controlling which classloader
the Ncs java vm should use.
|
Modifier and Type | Method and Description |
---|---|
static void |
abortNcsJavaVM(Object obj)
Abort Ncs Java VM
|
static void |
abortNcsJavaVM(Object obj,
int code)
Abort Ncs Java VM
|
static void |
abortNcsJavaVM(Object obj,
int code,
String message)
Abort Ncs Java VM
|
com.tailf.ncs.ctrl.ApplicationMuxManager |
getApplicationMuxManager()
Get the ApplicationMuxManager.
|
com.tailf.ncs.ctrl.DpMuxManager |
getDPMuxManager()
Get the DpMuxManager.
|
static NcsMain |
getInstance()
Get the singleton instance of the NcsMain class
|
static NcsMain |
getInstance(String host,
int port)
Get the singleton instance of the NcsMain class
|
String |
getNcsHost()
Get the hostname or ip for the Ncs Server
|
int |
getNcsPort()
Get the port number for the Ncs Server
|
com.tailf.ncs.ctrl.NedMuxManager |
getNedMuxManager()
Get the NedMuxManager.
|
AlarmSinkCentral |
getSinkCentral()
Get the Ncs AlarmSinkCentral instance
|
AlarmSourceCentral |
getSourceCentral()
Get the Ncs AlarmSourceCentral instance
|
void |
instantiatePackageComponent(com.tailf.ncs.ctrl.NcsPDData pdData)
Instantiates and registers components for a Ncs Package
|
static boolean |
isNcsMainCtrl()
Checks if this Ncs java main is instantiated in legacy mode.
|
static boolean |
isStarted()
Check if Ncs main thread is started
|
static boolean |
isTailFClassloader()
Checks if NcsMain was started with the Tail-f Jar classloader, as
opposed to running with the standard java system classloader.
|
String[] |
listSharedJars()
JMX interface - list shared jars
|
void |
redeployAll()
JMX interface - hot redeploy all packages
|
void |
redeployPackage(com.tailf.ncs.ctrl.NcsPDData pdData)
Hot redeploy of all components for a package
|
static Throwable |
reportPackageException(ClassLoader cl,
Throwable e) |
static Throwable |
reportPackageException(Object instance,
Throwable e) |
static Throwable |
reportPackageException(String packageName,
Throwable e) |
void |
restartPackage(String packageName) |
void |
restartPackageNow(String packageName) |
void |
run()
This method is the Ncs java vm main thread start
|
void |
shutdown()
JMX interface - shutdown Ncs java vm main thread
|
static void |
submitPackageAlarm(ClassLoader cl,
ConfIdentityRef alarmType,
PerceivedSeverity severity,
boolean cleared,
String alarmText) |
static void |
submitPackageAlarm(Object instance,
ConfIdentityRef alarmType,
PerceivedSeverity severity,
boolean cleared,
String alarmText) |
static void |
submitPackageAlarm(String packageName,
ConfIdentityRef alarmType,
PerceivedSeverity severity,
boolean cleared,
String alarmText) |
void |
uncaughtException(Thread t,
Throwable e) |
public static final String TAILF_CLASSLOADER
public String getNcsHost()
public int getNcsPort()
public AlarmSinkCentral getSinkCentral()
public AlarmSourceCentral getSourceCentral()
public com.tailf.ncs.ctrl.DpMuxManager getDPMuxManager()
public com.tailf.ncs.ctrl.NedMuxManager getNedMuxManager()
public com.tailf.ncs.ctrl.ApplicationMuxManager getApplicationMuxManager()
public void run()
public static boolean isNcsMainCtrl()
public static boolean isTailFClassloader()
public void instantiatePackageComponent(com.tailf.ncs.ctrl.NcsPDData pdData) throws Exception
pdData
- Exception
public void redeployPackage(com.tailf.ncs.ctrl.NcsPDData pdData) throws Exception
pdData
- Exception
public static boolean isStarted()
public static NcsMain getInstance()
public static NcsMain getInstance(String host, int port)
host
- port
- public static void abortNcsJavaVM(Object obj)
obj
- public static void abortNcsJavaVM(Object obj, int code)
obj
- code
- public static void abortNcsJavaVM(Object obj, int code, String message)
obj
- code
- message
- public static Throwable reportPackageException(ClassLoader cl, Throwable e)
public static Throwable reportPackageException(String packageName, Throwable e)
public static void submitPackageAlarm(Object instance, ConfIdentityRef alarmType, PerceivedSeverity severity, boolean cleared, String alarmText)
public static void submitPackageAlarm(ClassLoader cl, ConfIdentityRef alarmType, PerceivedSeverity severity, boolean cleared, String alarmText)
public static void submitPackageAlarm(String packageName, ConfIdentityRef alarmType, PerceivedSeverity severity, boolean cleared, String alarmText)
public void shutdown()
shutdown
in interface NcsMainMBean
public void redeployAll()
redeployAll
in interface NcsMainMBean
public void restartPackage(String packageName)
public void restartPackageNow(String packageName)
public String[] listSharedJars()
listSharedJars
in interface NcsMainMBean
public void uncaughtException(Thread t, Throwable e)
uncaughtException
in interface Thread.UncaughtExceptionHandler