Examples of InitialContextFactory


Examples of javax.naming.spi.InitialContextFactory

    protected void setUp() throws Exception
    {
        super.setUp();
        TransportConnection.createVMBroker(1);

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'");
        env.put("queue.queue", "direct://amq.direct//" + this.getClass().getName());

        _context = factory.getInitialContext(env);

        _queue = (Queue) _context.lookup("queue");

        // Create Client 1
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

    public InitialContextFactory createInitialContextFactory(Hashtable<?, ?> env) throws NamingException {
        if (tracker == null) {
            throw new IllegalStateException("OSGiInitialContextFactoryBuilder is not initialized");
        }
        InitialContextFactory factory = null;
        InitialContextFactoryBuilder factoryBuilder = (InitialContextFactoryBuilder) tracker.getService();
        if (factoryBuilder != null) {
            factory = factoryBuilder.createInitialContextFactory(env);
        }
        if (factory == null && env != null) {
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

    protected void setUp() throws Exception {
        super.setUp();

        configureEnvironment();

        InitialContextFactory factory = new ActiveMQInitialContextFactory();
        context = factory.getInitialContext(environment);
        assertTrue("No context created", context != null);
    }
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

    protected void setUp() throws Exception {
        super.setUp();

        configureEnvironment();

        InitialContextFactory factory = new ActiveMQInitialContextFactory();
        context = factory.getInitialContext(environment);
        assertTrue("No context created", context != null);
    }
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

    }

    private Context getIntraVmContext(Hashtable env) throws javax.naming.NamingException {
        Context context = null;
        try {
            InitialContextFactory factory = null;
            ClassLoader cl = SystemInstance.get().getClassLoader();
            Class ivmFactoryClass = Class.forName("org.apache.openejb.core.ivm.naming.InitContextFactory", true, cl);

            factory = (InitialContextFactory) ivmFactoryClass.newInstance();
            context = factory.getInitialContext(env);
        } catch (Exception e) {
            throw (NamingException)new javax.naming.NamingException("Cannot instantiate an IntraVM InitialContext. Exception: "
                    + e.getClass().getName() + " " + e.getMessage()).initCause(e);
        }
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

        if (usingInVMBroker())
        {
            TransportConnection.createVMBroker(1);
        }

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();
        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@PRIORITY_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);

        context = factory.getInitialContext(env);
        producerConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
        producerSession = producerConnection.createSession(true, Session.AUTO_ACKNOWLEDGE);

        producerConnection.start();
       
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

        if (BROKER.startsWith("vm://"))
        {
            TransportConnection.createVMBroker(1);
        }
        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID/" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);

        _context = factory.getInitialContext(env);

    }
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

        super.tearDown();
    }

    public void testPassiveTTL() throws JMSException, NamingException
    {
        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
        env.put("queue.queue", QUEUE);
                                          
        Context context = factory.getInitialContext(env);

        Queue queue = (Queue) context.lookup("queue");

        //Create Client 1
        Connection clientConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

    protected void setUp() throws Exception
    {
        super.setUp();
        TransportConnection.createVMBroker(1);

        InitialContextFactory factory = new PropertiesFileInitialContextFactory();

        Hashtable<String, String> env = new Hashtable<String, String>();

        env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'");
        env.put("queue.queue", "MessageListenerTest");

        _context = factory.getInitialContext(env);

        Queue queue = (Queue) _context.lookup("queue");

        // Create Client 1
        _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
View Full Code Here

Examples of javax.naming.spi.InitialContextFactory

    protected void setUp() throws Exception {
        super.setUp();

        configureEnvironment();

        InitialContextFactory factory = new ActiveMQInitialContextFactory();
        context = factory.getInitialContext(environment);
        assertTrue("No context created", context != null);
    }
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.