Package javax.management

Examples of javax.management.JMException


            //ignore, likely on Java5
        }
        try {
            return new ObjectName("JMImplementation:type=MBeanServerDelegate");
        } catch (MalformedObjectNameException e) {
            JMException jme = new JMException(e.getMessage());
            jme.initCause(e);
            throw jme;
        }
    }
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, persist(name), forceRegistration);
    }
View Full Code Here

            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }
    }
View Full Code Here

    {
        VirtualHost vhost = getExchange().getVirtualHost();
        AMQQueue queue = vhost.getQueueRegistry().getQueue(new AMQShortString(queueName));
        if (queue == null)
        {
            throw new JMException("Queue \"" + queueName + "\" is not registered with the virtualhost.");
        }

        CurrentActor.set(new ManagementActor(_logActor.getRootMessageLogger()));
        try
        {
            vhost.getBindingFactory().addBinding(binding,queue,getExchange(),null);
        }
        catch (AMQException ex)
        {
            JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error creating new binding " + binding);
        }
        CurrentActor.remove();
    }
View Full Code Here

    {
        VirtualHost vhost = getExchange().getVirtualHost();
        AMQQueue queue = vhost.getQueueRegistry().getQueue(new AMQShortString(queueName));
        if (queue == null)
        {
            throw new JMException("Queue \"" + queueName + "\" is not registered with the virtualhost.");
        }

        CurrentActor.set(new ManagementActor(_logActor.getRootMessageLogger()));
        try
        {
            vhost.getBindingFactory().removeBinding(binding, queue, _exchange, Collections.<String, Object>emptyMap());
        }
        catch (AMQException ex)
        {
            JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error removing binding " + binding);
        }
        CurrentActor.remove();
    }
View Full Code Here

        {
            _queue.setExclusive(exclusive);
        }
        catch (AMQException e)
        {
            throw new JMException(e.toString());
        }
    }
View Full Code Here

                _messageList.put(messageData);
            }
        }
        catch (AMQException e)
        {
            JMException jme = new JMException("Error creating message contents: " + e);
            jme.initCause(e);
            throw jme;
        }

        return _messageList;
    }
View Full Code Here

                        _durableConfig.createExchange(exchange);
                    }
                }
                else
                {
                    throw new JMException("The exchange \"" + exchangeName + "\" already exists.");
                }
            }
        }
        catch (AMQException ex)
        {
            JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error in creating exchange " + exchangeName);
        }
        finally
        {
            CurrentActor.remove();
View Full Code Here

        {
            _exchangeRegistry.unregisterExchange(new AMQShortString(exchangeName), false);
        }
        catch (AMQException ex)
        {
            JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error in unregistering exchange " + exchangeName);
        }
        finally
        {
            CurrentActor.remove();
View Full Code Here

    public void createNewQueue(String queueName, String owner, boolean durable) throws JMException, MBeanException
    {
        AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
        if (queue != null)
        {
            throw new JMException("The queue \"" + queueName + "\" already exists.");
        }

        CurrentActor.set(new ManagementActor(_logActor.getRootMessageLogger()));
        try
        {
            AMQShortString ownerShortString = null;
            if (owner != null)
            {
                ownerShortString = new AMQShortString(owner);
            }

            queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString(queueName), durable, ownerShortString, false, false, getVirtualHost(), null);
            if (queue.isDurable() && !queue.isAutoDelete())
            {
                _durableConfig.createQueue(queue);
            }

            _queueRegistry.registerQueue(queue);
        }
        catch (AMQException ex)
        {
            JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error in creating queue " + queueName);
        }
        finally
        {
            CurrentActor.remove();
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.