|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mq.jms.MQConnectionFactory | +--com.ibm.mq.jms.Cleanup
Cleanup contains utilities for dealing with nondurable subscriptions which are broken,
by using the SUBSTATE(BROKER) option.
The class is not applicable if you use a direct connection to a broker.
Field Summary |
Constructor Summary | |
Cleanup()
Default constructor. |
|
Cleanup(MQConnectionFactory mqcf)
Constructor that imports property values. |
Method Summary | |
void |
cleanup()
Runs Cleanup once. |
long |
getCleanupInterval()
Gets the cleanup interval. |
int |
getCleanupLevel()
Gets the cleanup level. |
javax.jms.ExceptionListener |
getExceptionListener()
Gets the ExceptionListener. |
boolean |
isRunning()
Indicates whether run() is currently active. |
static void |
main(java.lang.String[] args)
Invokes the utility directly from a command line. |
void |
run()
Runs Cleanup. |
void |
setCleanupInterval(long interval)
Sets the cleanup interval. |
void |
setCleanupLevel(int level)
Sets the cleanup level. |
void |
setExceptionListener(javax.jms.ExceptionListener el)
Sets the ExceptionListener. |
void |
setPassword(java.lang.String newPassword)
Sets the durable connection password |
void |
setUserID(java.lang.String newuserID)
Sets the durable connection user ID. |
void |
stop()
Stops any running cleanup thread. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Cleanup()
public Cleanup(MQConnectionFactory mqcf) throws javax.jms.JMSException
mqcf
- the topic connection factory that provides the values.Method Detail |
public void setCleanupInterval(long interval) throws javax.jms.JMSException
setCleanupInterval
in class MQConnectionFactory
interval
- the cleanup interval in milliseconds.
javax.jms.JMSException
- if interval is either null or invalid.public long getCleanupInterval()
getCleanupInterval
in class MQConnectionFactory
public void setCleanupLevel(int level) throws javax.jms.JMSException
setCleanupLevel
in class MQConnectionFactory
level
- the cleanup level.
The following values are accepted:
javax.jms.JMSException
- if level is not supported or if an illegal state is encountered.public int getCleanupLevel()
getCleanupLevel
in class MQConnectionFactory
setCleanupLevel(int level)
public void setPassword(java.lang.String newPassword)
newPassword
- the new password.public void setUserID(java.lang.String newuserID)
newuserID
- the new user ID.public static void main(java.lang.String[] args) throws java.io.UnsupportedEncodingException
Cleanup [-m
Syntax for client attach:
Cleanup -client [-m
setCleanupLevel
.
java.io.UnsupportedEncodingException
public void run()
setCleanupLevel()
and setCleanupInterval
.
If the field set by setCleanupInterval() is zero, Cleanup runs once and returns.
Otherwise Cleanup runs regularly at the time in milliseconds set by setCleanupInterval()
.
CleanupInterval must be zero with JMSC.MQJMS_CLEANUP_FORCE
or JMSC.MQJMS_CLEANUP_NONDUR
set,
and CleanupLevel cannot be MQJMS_CLEANUP_NONE
.
In these cases the method fails with an IllegalStateException.
Any exceptions generated are routed to the ExceptionListener.
run
in interface java.lang.Runnable
public void stop()
run()
has finished.
Does nothing if run()
is not running.
public void setExceptionListener(javax.jms.ExceptionListener el)
run()
is running.
Cleanup terminates shortly after issuing the exception to the ExceptionListener.
el
- the exception listener.public javax.jms.ExceptionListener getExceptionListener()
public boolean isRunning()
run()
is currently active.
true
if active; false
otherwise.public void cleanup() throws javax.jms.JMSException
javax.jms.IllegalStateException
- if CleanupLevel is JMSC.MQJMS_CLEANUP_NONE
.
javax.jms.JMSException
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |