Examples of Broker


Examples of net.sourceforge.orbroker.Broker

    dsControl.replay();
    conControl.replay();

    // run scenario
    Resource config = new ClassPathResource("org/springmodules/orm/orbroker/broker.xml");
    Broker broker = new Broker(config.getInputStream(), ds);
    BrokerTemplate brokerTemplate = new BrokerTemplate();
    brokerTemplate.setBroker(broker);
    brokerTemplate.afterPropertiesSet();

    Object result = brokerTemplate.execute(new BrokerCallback() {
View Full Code Here

Examples of net.sourceforge.orbroker.Broker

    prepareNewBrokerInternals(dsControl, ds);

    dsControl.replay();

    BrokerTemplate template = new BrokerTemplate();
    Broker broker = new Broker(ds);
    template.setBroker(broker);
    assertEquals(broker, template.getBroker());

    BrokerDaoSupport testDao = new BrokerDaoSupport() {
    };
View Full Code Here

Examples of net.sourceforge.orbroker.Broker

    // some assertions
    Assert.notNull(dataSource, "dataSource can not be null");

    // create and initialize the broker
    if (this.configLocation != null) {
      this.broker = new Broker(configLocation.getInputStream(), dataSource);
    } else {
      this.broker = new Broker(dataSource);
    }

    // register text replacements
    if (this.textReplacements != null && !this.textReplacements.isEmpty())
      this.broker.setTextReplacements(this.textReplacements);
View Full Code Here

Examples of org.activemq.broker.Broker

        ActiveMQConnection connection2 = (ActiveMQConnection) factory2.createConnection();
        assertNotNull(connection2);
       
        VmTransportChannel transportChannel = (VmTransportChannel) connection.getTransportChannel();
        BrokerClientImpl brokerClient = (BrokerClientImpl)transportChannel.getSendListener();
        Broker broker = brokerClient.getBrokerConnector().getBrokerContainer().getBroker();
       
        VmTransportChannel transportChannel2 = (VmTransportChannel) connection2.getTransportChannel();
        BrokerClientImpl brokerClient2 = (BrokerClientImpl)transportChannel2.getSendListener();
        Broker broker2 = brokerClient2.getBrokerConnector().getBrokerContainer().getBroker();
       
        assertTrue( broker == broker2 );
       
    }
View Full Code Here

Examples of org.apache.activemq.apollo.broker.Broker

    public static void main(String[] args) throws Exception {

        //
        // Creating and initially configuring the broker.
        Broker broker = new Broker();
        broker.setTmp(new File("./tmp"));
        broker.setConfig(createConfig());

        //
        // The broker starts asynchronously. The runnable is invoked once
        // the broker if fully started.
        System.out.println("Starting the broker.");
        broker.start(new Runnable(){
            public void run() {
                System.out.println("The broker has now started.");
                System.out.println("Press enter to change the broker port...");
            }
        });

        System.in.read();
        System.out.println("Updating the broker configuration.");
       
        //
        // The configuration update also occurs asnyc.
        broker.update(createUpdate(), new Runnable() {
            public void run() {
                System.out.println("The configuration has been applied.");
                System.out.println("Press enter to stop the broker...");
            }
        });

        System.in.read();
        System.out.println("Stopping the broker.");
       
        //
        // The broker stops asynchronously. The runnable is invoked once
        // the broker if fully stopped.
        broker.stop(new Runnable(){
            public void run() {
                System.out.println("The broker has now stopped.");
            }
        });
       
View Full Code Here

Examples of org.apache.activemq.broker.Broker

    /**
     * Sends a message to the given destination which may be a wildcard
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination)
        throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set destinations = broker.getDestinations(destination);

        for (Iterator iter = destinations.iterator(); iter.hasNext();) {
            Destination dest = (Destination)iter.next();
            dest.send(context, message);
        }
View Full Code Here

Examples of org.apache.openjpa.kernel.Broker

                    "openjpa.ConnectionRetainMode", obj),
                    new Throwable[]{ e }, obj, true);
            }
        }

        Broker broker = _factory.newBroker(user, pass, managed, retainMode,
            false);
           
        // add autodetach for close and rollback conditions to the configuration
        broker.setAutoDetach(AutoDetach.DETACH_CLOSE, true);
        broker.setAutoDetach(AutoDetach.DETACH_ROLLBACK, true);
       
        broker.setDetachedNew(false);
        OpenJPAEntityManagerSPI em = newEntityManagerImpl(broker);

        // allow setting of other bean properties of EM
        String[] prefixes = ProductDerivations.getConfigurationPrefixes();
        List<RuntimeException> errs = null;
View Full Code Here

Examples of org.apache.openjpa.kernel.Broker

        PersistenceCapable pc = (PersistenceCapable)entity;
        if (!(pc.pcGetGenericContext() instanceof Broker)) {
            return false;
        }
        // Assert the broker is available and open
        Broker broker = (Broker)pc.pcGetGenericContext();
        if (broker == null || broker.isClosed()) {
            return false;
        }
        // Assert the emf associated with the PC is the same as the provided emf
        OpenJPAEntityManagerFactory eemf = JPAFacadeHelper.toEntityManagerFactory(broker.getBrokerFactory());
        if (eemf == emf && eemf.isOpen()) {
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.apache.openjpa.kernel.Broker

                AbstractBrokerFactory.getPooledFactoryForKey(factoryKey);
            byte[] brokerBytes = (byte[]) in.readObject();
            ObjectInputStream innerIn = new BrokerBytesInputStream(brokerBytes,
                factory.getConfiguration());

            Broker broker = (Broker) innerIn.readObject();
            EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl)
                JPAFacadeHelper.toEntityManagerFactory(
                    broker.getBrokerFactory());
            broker.putUserObject(JPAFacadeHelper.EM_KEY, this);
            initialize(emf, broker);
        } catch (RuntimeException re) {
            try {
                re = _ret.translate(re);
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.openjpa.kernel.Broker

                log.trace("Found ConnectionFactory2Name from props: " + cf2Name);
            }
        }
        validateCfNameProps(conf, cfName, cf2Name);

        Broker broker = _factory.newBroker(user, pass, managed, retainMode, false, cfName, cf2Name);
           
        // add autodetach for close and rollback conditions to the configuration
        broker.setAutoDetach(AutoDetach.DETACH_CLOSE, true);
        broker.setAutoDetach(AutoDetach.DETACH_ROLLBACK, true);
        broker.setDetachedNew(false);
       
        OpenJPAEntityManagerSPI em = newEntityManagerImpl(broker);

        // allow setting of other bean properties of EM
        Set<Map.Entry> entrySet = props.entrySet();
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.