Examples of IApplicationRegistry


Examples of org.apache.qpid.server.registry.IApplicationRegistry

        {
            CurrentActor.get().message(ManagementConsoleMessages.READY(true));
            return;
        }

        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
        int port = appRegistry.getConfiguration().getJMXManagementPort();


        //Socket factories for the RMIConnectorServer, either default or SLL depending on configuration
        RMIClientSocketFactory csf;
        RMIServerSocketFactory ssf;

        //check ssl enabled option in config, default to true if option is not set
        boolean sslEnabled = appRegistry.getConfiguration().getManagementSSLEnabled();

        if (sslEnabled)
        {
            //set the SSL related system properties used by the SSL RMI socket factories to the values
            //given in the configuration file, unless command line settings have already been specified
            String keyStorePath;

            if(System.getProperty("javax.net.ssl.keyStore") != null)
            {
                keyStorePath = System.getProperty("javax.net.ssl.keyStore");
            }
            else
            {
                keyStorePath = appRegistry.getConfiguration().getManagementKeyStorePath();
            }

            //check the keystore path value is valid
            if (keyStorePath == null)
            {
                throw new ConfigurationException("JMX management SSL keystore path not defined, " +
                                             "unable to start SSL protected JMX ConnectorServer");
            }
            else
            {
                //ensure the system property is set
                System.setProperty("javax.net.ssl.keyStore", keyStorePath);

                //check the file is usable
                File ksf = new File(keyStorePath);

                if (!ksf.exists())
                {
                    throw new FileNotFoundException("Cannot find JMX management SSL keystore file " + ksf + "\n"
                                                  + "Check broker configuration, or see create-example-ssl-stores script"
                                                  + "in the bin/ directory if you need to generate an example store.");
                }
                if (!ksf.canRead())
                {
                    throw new FileNotFoundException("Cannot read JMX management SSL keystore file: "
                                                    + ksf +  ". Check permissions.");
                }
               
                CurrentActor.get().message(ManagementConsoleMessages.SSL_KEYSTORE(ksf.getAbsolutePath()));
            }

            //check the key store password is set
            if (System.getProperty("javax.net.ssl.keyStorePassword") == null)
            {

                if (appRegistry.getConfiguration().getManagementKeyStorePassword() == null)
                {
                    throw new ConfigurationException("JMX management SSL keystore password not defined, " +
                                                   "unable to start requested SSL protected JMX server");
                }
                else
                {
                   System.setProperty("javax.net.ssl.keyStorePassword",
                           appRegistry.getConfiguration().getManagementKeyStorePassword());
                }
            }

            //create the SSL RMI socket factories
            csf = new SslRMIClientSocketFactory();
            ssf = new SslRMIServerSocketFactory();
        }
        else
        {
            //Do not specify any specific RMI socket factories, resulting in use of the defaults.
            csf = null;
            ssf = null;
        }

        //add a JMXAuthenticator implementation the env map to authenticate the RMI based JMX connector server
        RMIPasswordAuthenticator rmipa = new RMIPasswordAuthenticator();
        rmipa.setAuthenticationManager(appRegistry.getAuthenticationManager());
        HashMap<String,Object> env = new HashMap<String,Object>();
        env.put(JMXConnectorServer.AUTHENTICATOR, rmipa);

        /*
         * Start a RMI registry on the management port, to hold the JMX RMI ConnectorServer stub.
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
        _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
        _messageStore = _virtualHost.getMessageStore();

        _transactionalContext = new NonTransactionalContext(_messageStore, _storeContext,
                                                            null,
                                                            new LinkedList<RequiredDeliveryException>(),
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
        _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
    }
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

{
//    private MessageStore _messageStore = new SkeletonMessageStore();

    public void testChannels() throws Exception
    {
        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
        AMQMinaProtocolSession _protocolSession = new AMQMinaProtocolSession(new MockIoSession(),
                                                                             appRegistry.getVirtualHostRegistry(),
                                                                             new AMQCodecFactory(true),
                                                                             null);
        _protocolSession.setVirtualHost(appRegistry.getVirtualHostRegistry().getVirtualHost("test"));

        // check the channel count is correct
        int channelCount = _protocolSession.getChannels().size();
        assertEquals("Initial channel count wrong", 0, channelCount);
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

        _consumer = _clientSession.createConsumer((Queue) _context.lookup("queue"), "key = 23");
    }

    private void verifyBrokerState()
    {
        IApplicationRegistry registry = ApplicationRegistry.getInstance();

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);
        assertNotNull("Unable to get test Vhost", testVhost);
        assertNotNull("Unable to get test queue registry", testVhost.getQueueRegistry());
        AMQQueue q = testVhost.getQueueRegistry().getQueue(new AMQShortString(QUEUE));
        assertNotNull("Unable to get test queue", q);
        assertEquals("Queue count too big", 0, q.getMessageCount());
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

    }

    // todo: collect to a general testing class - duplicated in AMQQueueMBeanTest
    private void getBrokerInitialState()
    {
        IApplicationRegistry registry = ApplicationRegistry.getInstance();

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);

        assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

    }

    private void verifyBrokerState()
    {
        IApplicationRegistry registry = ApplicationRegistry.getInstance();

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);

        assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

        _accessManager = new AllowAll();

        _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);

        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
        _managedObjectRegistry = appRegistry.getManagedObjectRegistry();
        _vHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test");
        _queueRegistry = _vHost.getQueueRegistry();
        _exchangeFactory = _vHost.getExchangeFactory();
        _exchangeRegistry = _vHost.getExchangeRegistry();

        _messageStore = new TestableMemoryMessageStore();
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

    private VirtualHost _virtualHost;

    public ConcurrencyTestDisabled() throws Exception
    {

        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
        _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
        _deliveryMgr = new ConcurrentSelectorDeliveryManager(_subscriptionMgr, new AMQQueue(new AMQShortString("myQ"), false, new AMQShortString("guest"), false,
                                                                          _virtualHost));
    }
View Full Code Here

Examples of org.apache.qpid.server.registry.IApplicationRegistry

    private boolean _useCustomSocketFactory;

    public JMXManagedObjectRegistry() throws AMQException
    {
        _log.info("Initialising managed object registry using platform MBean server");
        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();

        // Retrieve the config parameters
        _useCustomSocketFactory = appRegistry.getConfiguration().getUseCustomRMISocketFactory();
        boolean platformServer = appRegistry.getConfiguration().getPlatformMbeanserver();

        _mbeanServer =
                platformServer ? ManagementFactory.getPlatformMBeanServer()
                : MBeanServerFactory.createMBeanServer(ManagedObject.DOMAIN);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.