|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opennms.bb.dp.common.components.PollerThread | +--org.opennms.bb.dp.capsd.components.CapsdWriteManager
CapsdWriteManager reads CapsReader objects from the in input queue and uses a thread pool of 'DBRunnableConsumerThread's to write this data to the database. The CapsdWriteManager converts the CapsReader objects into CapsWriter objects and enqueues the new writer for execution by the DBRunnableConsumerThreads.
Field Summary | |
private static String |
JSDT_CLIENT_NAME
The name of the JSDT client for all instances of this object. |
private PCQueue |
m_capsWriterQ
Queue to which this adds CapsWriter objects which then run and all the data collected to the database. |
private com.sun.media.jsdt.Channel |
m_channel
The actual channel used to exchange messages between systems. |
private PollerClient |
m_client
The client that is joined to the JSDT session. |
private PCQueue |
m_mgrInputQ
Queue to which CapsReader objects that have results of the SNMP, service queries are added by the CapsdReadManager. |
private com.sun.media.jsdt.Session |
m_session
The JSDT Session that is used to communicate with the discovery system. |
private List |
m_threads
The list of DBRunnableConsumerThreads that are being managed by this instance. |
private static int |
NUM_WRITERS
The number of thread writers to start for the manager. |
Fields inherited from class org.opennms.bb.dp.common.components.PollerThread |
m_curOpStatus, STATUS_MASK, STATUS_NORMAL, STATUS_PAUSED, STATUS_PAUSING, STATUS_RESUMING, STATUS_SHUTDOWN, STATUS_STARTING, STATUS_TERMINATING |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
private |
CapsdWriteManager()
The default constructor for the class is not supported. |
|
CapsdWriteManager(PCQueue Q)
Constructs a new CapsdWriteManager object that maintains a DBRunnableConsumerThread thread pool to handle the serilization of data to persistant storage (the database). |
Method Summary | |
void |
connect()
Creates the poller JSDT client and channel to be used by the CapsWriter object to send confirmation to discovery once a node has been added to the database. |
void |
run()
Starts the thread pool, reads CapsReader objects from the m_mgrInputQ, constructs CapsWriter objects and adds them to the m_capsWriterQ. |
void |
shutdown()
Initiates the shutdown sequence and then waits for the thread's run method to exit. |
Methods inherited from class org.opennms.bb.dp.common.components.PollerThread |
getCtrlStatus, getOpStatus, pauseOperation, pauseThread, resumeOperation, resumeThread, setCtrlStatus, setOpStatus, setUserStatus, shutdownThread |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private PCQueue m_mgrInputQ
Queue to which CapsReader objects that have results of the SNMP, service queries are added by the CapsdReadManager.
private PCQueue m_capsWriterQ
Queue to which this adds CapsWriter objects which then run and all the data collected to the database.
private static final int NUM_WRITERS
The number of thread writers to start for the manager.
private List m_threads
The list of DBRunnableConsumerThreads that are being managed by this instance.
private PollerClient m_client
The client that is joined to the JSDT session.
private com.sun.media.jsdt.Session m_session
The JSDT Session that is used to communicate with the discovery system.
private com.sun.media.jsdt.Channel m_channel
The actual channel used to exchange messages between systems.
private static final String JSDT_CLIENT_NAME
The name of the JSDT client for all instances of this object. There should only ever be one instances since clients must be unique.
Constructor Detail |
private CapsdWriteManager() throws UnsupportedOperationException
The default constructor for the class is not supported. This constructor will always throw and UnsupportedOperationException.
UnsupportedOperationException
- Always thrown
from this method.public CapsdWriteManager(PCQueue Q) throws com.sun.media.jsdt.JSDTException, SQLException
Constructs a new CapsdWriteManager object that maintains a DBRunnableConsumerThread thread pool to handle the serilization of data to persistant storage (the database).
Q
- The input queue where CapsReader objects are received.
These CapsReader objects contain results of the
SNMP and services staus queries.java.lang.NullPointerException
- Thrown when database
related properites is not found.com.sun.media.jsdt.JSDTException
- Thrown when the
JSDT communication channel cannot be established.SQLException
- Thrown if there is an error
creating the connections to the database.Method Detail |
public void run()
Starts the thread pool, reads CapsReader objects from the m_mgrInputQ, constructs CapsWriter objects and adds them to the m_capsWriterQ. In short the run method is a transform thread that reads CapsReader objects from one queue and writes CapsWriter objects to another. The thread pool started and managed by the object read from the manager's queue and process the queues objects.
run
in class Thread
public void shutdown()
Initiates the shutdown sequence and then waits for the thread's run method to exit. If the thread that calls shutdown is the same thread being terminated, then a join() will not occur to prevent a deadlock.
shutdown
in class PollerThread
org.opennms.bb.dp.common.components.PollerThread
PollerThread.STATUS_TERMINATING
,
Object.notifyAll()
public void connect() throws com.sun.media.jsdt.JSDTException
Creates the poller JSDT client and channel to be used by the CapsWriter object to send confirmation to discovery once a node has been added to the database.
com.sun.media.jsdt.JSDTException
- thrown when the JSDT communication
channel cannot be established.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |