Package javax.management

Examples of javax.management.OperationsException


        VirtualHost<?,?,?> virtualHost = _virtualHostMBean.getVirtualHost();
        Exchange<?> exchange = virtualHost.getChildByName(Exchange.class, exchangeName);

        if (exchange == null)
        {
            throw new OperationsException("No such exchange \""+ exchangeName +"\"");
        }

        try
        {
            exchange.deleteWithChecks();
View Full Code Here


    {
        VirtualHost<?,?,?> virtualHost = _virtualHostMBean.getVirtualHost();
        Queue<?> queue = virtualHost.getChildByName(Queue.class, queueName);
        if (queue == null)
        {
            throw new OperationsException("No such queue \""+ queueName +"\"");
        }
        queue.deleteAndReturnCount();
    }
View Full Code Here

                _queue.setAttributes(Collections.<String,Object>singletonMap(Queue.ALTERNATE_EXCHANGE, exchangeName));
            }
            catch (IllegalArgumentException e)
            {
                throw new OperationsException("No such exchange \""+exchangeName+"\"");
            }
        }
    }
View Full Code Here

    public TabularData viewMessages(long startPosition, long endPosition)
            throws IOException, JMException
    {
        if ((startPosition > endPosition) || (startPosition < 1))
        {
            throw new OperationsException("From Index = " + startPosition + ", To Index = " + endPosition
                + "\n\"From Index\" should be greater than 0 and less than \"To Index\"");
        }

        if ((endPosition - startPosition) > Integer.MAX_VALUE)
        {
            throw new OperationsException("Specified MessageID interval is too large. Intervals must be less than 2^31 in size");
        }


        List<QueueEntry> messages = getMessages(startPosition, endPosition);
View Full Code Here

            throws IOException, JMException
    {
        QueueEntry entry = getMessage(messageId);
        if(entry == null)
        {
            throw new OperationsException("AMQMessage with message id = " + messageId + " is not in the " + _queue.getName());
        }

        ServerMessage serverMsg = entry.getMessage();
        final int bodySize = (int) serverMsg.getSize();
View Full Code Here

    public void moveMessages(final long fromMessageId, final long toMessageId, String toQueue)
            throws IOException, JMException
    {
        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater than 0 and less than \"To MessageId\"");
        }

        VirtualHost<?,?,?> vhost = _queue.getParent(VirtualHost.class);
        final Queue<?> destinationQueue = vhost.getChildByName(Queue.class, toQueue);
        if (destinationQueue == null)
        {
            throw new OperationsException("No such queue \""+ toQueue +"\"");
        }

        vhost.executeTransaction(new VirtualHost.TransactionalOperation()
        {
            public void withinTransaction(final VirtualHost.Transaction txn)
View Full Code Here

    public void copyMessages(final long fromMessageId, final long toMessageId, String toQueue)
            throws IOException, JMException
    {
        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater than 0 and less than \"To MessageId\"");
        }

        VirtualHost<?,?,?> vhost = _queue.getParent(VirtualHost.class);
        final Queue<?> destinationQueue = vhost.getChildByName(Queue.class, toQueue);
        if (destinationQueue == null)
        {
            throw new OperationsException("No such queue \""+ toQueue +"\"");
        }
        vhost.executeTransaction(new VirtualHost.TransactionalOperation()
        {
            public void withinTransaction(final VirtualHost.Transaction txn)
            {
View Full Code Here

        VirtualHost<?,?,?> virtualHost = _exchange.getParent(VirtualHost.class);
        Queue<?> queue = virtualHost.getChildByName(Queue.class, queueName);
        if (queue == null)
        {
            throw new OperationsException("No such queue \""+ queueName +"\"");
        }
        _exchange.createBinding(binding, queue, arguments, Collections.EMPTY_MAP);
    }
View Full Code Here

    {
        VirtualHost<?,?,?> virtualHost = _exchange.getParent(VirtualHost.class);
        Queue<?> queue = virtualHost.getChildByName(Queue.class, queueName);
        if (queue == null)
        {
            throw new OperationsException("No such queue \""+ queueName +"\"");
        }

        boolean deleted = false;
        for(Binding binding : _exchange.getBindings())
        {
            if(queue.equals(binding.getParent(Queue.class)) && bindingKey.equals(binding.getName()))
            {
                binding.delete();
                deleted = true;
            }
        }

        if (!deleted)
        {
            throw new OperationsException("No such binding \"" + bindingKey + "\" on queue \"" + queueName + "\"");
        }
    }
View Full Code Here

        bIn   = new ByteArrayInputStream(data);
        try {
            objIn = new ObjectInputStreamWithLoader(bIn,loader);
        } catch (IOException e) {
            throw new OperationsException(
                     "An IOException occurred trying to de-serialize the data");
        }

        return objIn;
    }
View Full Code Here

TOP

Related Classes of javax.management.OperationsException

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.