Search in sources :

Example 6 with ManagedOperation

use of org.apache.cxf.management.annotation.ManagedOperation in project cxf by apache.

the class ManagedRMEndpoint method closeSourceSequence.

@ManagedOperation(description = "Close Source Sequence")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public void closeSourceSequence(String sid) throws JMException {
    SourceSequence ss = getSourceSeq(sid);
    if (null == ss) {
        throw new JMException("no source sequence");
    }
    RetransmissionQueue rq = endpoint.getManager().getRetransmissionQueue();
    rq.stop(ss);
    Proxy proxy = endpoint.getProxy();
    try {
        proxy.lastMessage(ss);
    } catch (RMException e) {
        e.printStackTrace();
        throw new JMException("Error closing sequence: " + e.getMessage());
    }
}
Also used : JMException(javax.management.JMException) ManagedOperationParameters(org.apache.cxf.management.annotation.ManagedOperationParameters) ManagedOperation(org.apache.cxf.management.annotation.ManagedOperation)

Aggregations

ManagedOperation (org.apache.cxf.management.annotation.ManagedOperation)6 ManagedOperationParameters (org.apache.cxf.management.annotation.ManagedOperationParameters)5 JMException (javax.management.JMException)3 ArrayList (java.util.ArrayList)2 AcknowledgementRange (org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange)2 Method (java.lang.reflect.Method)1 Descriptor (javax.management.Descriptor)1 ManagedAttribute (org.apache.cxf.management.annotation.ManagedAttribute)1 ManagedNotification (org.apache.cxf.management.annotation.ManagedNotification)1 ManagedOperationParameter (org.apache.cxf.management.annotation.ManagedOperationParameter)1 ManagedResource (org.apache.cxf.management.annotation.ManagedResource)1