Package javax.management

Examples of javax.management.JMException


    public void deleteQueue(String queueName) throws JMException, MBeanException
    {
        AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
        if (queue == null)
        {
            throw new JMException("The Queue " + queueName + " is not a registered queue.");
        }

        CurrentActor.set(new ManagementActor(_logActor.getRootMessageLogger()));
        try
        {
            queue.delete();
            if (queue.isDurable())
            {
                _durableConfig.removeQueue(queue);
            }
        }
        catch (AMQException ex)
        {
            JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error in deleting queue " + queueName);
        }
        finally
        {
            CurrentActor.remove();
View Full Code Here


        try
        {
            AMQChannel channel = _protocolSession.getChannel(channelId);
            if (channel == null)
            {
                throw new JMException("The channel (channel Id = " + channelId + ") does not exist");
            }

            _protocolSession.commitTransactions(channel);
        }
        catch (AMQException ex)
View Full Code Here

    }

    private JMException buildUnsupportedException() throws JMException
    {
        String msg = "Operation not supported";
        JMException jmException = new JMException(msg);
        jmException.initCause(new UnsupportedOperationException(msg));
        return jmException;
    }
View Full Code Here

            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
        rtMBean.setModelMBeanInfo(mbi);
        try {
            rtMBean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException itotex) {
            throw new JMException(itotex.getMessage());
        }
        registerMBeanWithServer(rtMBean, name, forceRegistration);
    }
View Full Code Here

        @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier")
    })
    public void resumeSourceQueue(String sid) throws JMException {
        SourceSequence ss = getSourceSeq(sid);
        if (null == ss) {
            throw new JMException("no source sequence");
        }
        RetransmissionQueue rq = endpoint.getManager().getRetransmissionQueue();
        rq.resume(ss);
    }
View Full Code Here

    public String getCurrentSourceSequenceId() throws JMException {
        Source source = endpoint.getSource();
        SourceSequence ss = source.getCurrent();

        if (null == ss) {
            throw new JMException("no source sequence");
        }
       
        return ss.getIdentifier().getValue();
    }
View Full Code Here

        @ManagedOperationParameter(name = "sequenceId", description = "The destination identifier")
    })
    public void removeSourceSequence(String sid) throws JMException {
        SourceSequence ss = getSourceSeq(sid);
        if (null == ss) {
            throw new JMException("no source sequence");
        }
        RetransmissionQueue rq = endpoint.getManager().getRetransmissionQueue();
        if (rq.countUnacknowledged(ss) > 0) {
            throw new JMException("sequence not empty");
        }
        rq.stop(ss);
        ss.getSource().removeSequence(ss);
    }
View Full Code Here

        @ManagedOperationParameter(name = "sequenceId", description = "The destination identifier")
    })
    public void removeDestinationSequence(String sid) throws JMException {
        DestinationSequence ds = getDestinationSeq(sid);
        if (null == ds) {
            throw new JMException("no source sequence");
        }
//         RedeliveryQueue rq = endpoint.getManager().getRedeliveryQueue();
//         rq.suspend(ds);
        ds.getDestination().removeSequence(ds);
    }
View Full Code Here

                                                               durable, false, 0);
                    _exchangeRegistry.registerExchange(exchange);
                }
                else
                {
                    throw new JMException("The exchange \"" + exchangeName + "\" already exists.");
                }
            }
        }
        catch (AMQException ex)
        {
View Full Code Here

        {
            AMQQueue queue = getQueueRegistry().getQueue(new AMQShortString(queueName));

            if (queue == null)
            {
                throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
            }

            String[] bindings = binding.split(",");
            FieldTable bindingMap = new FieldTable();
            for (int i = 0; i < bindings.length; i++)
            {
                String[] keyAndValue = bindings[i].split("=");
                if (keyAndValue == null || keyAndValue.length < 2)
                {
                    throw new JMException("Format for headers binding should be \"<attribute1>=<value1>,<attribute2>=<value2>\" ");
                }
                bindingMap.setString(keyAndValue[0], keyAndValue[1]);
            }

            _bindings.add(new Registration(new HeadersBinding(bindingMap), queue));
View Full Code Here

TOP

Related Classes of javax.management.JMException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.