Examples of ConnectionFactory


Examples of de.fu_berlin.inf.dpp.videosharing.net.ConnectionFactory

        requestingSession = true;
        try {
            if (videoSharingSessionObservable.getValue() != null) {
                return;
            }
            ConnectionFactory connectionFactory = null;
            StreamSession streamSession = null;

            try {
                if (to.isLocal()) {
                    connectionFactory = new ConnectionFactory();
                    videoSharingSessionObservable
                        .setValue(new VideoSharingSession(connectionFactory, to));
                    return;
                }
                try {
                    streamSession = streamServiceManager.createSession(
                        videoSharingService, to, VideoSharingInit.create(this),
                        null);
                    connectionFactory = new ConnectionFactory(streamSession,
                        Mode.HOST);
                    videoSharingSessionObservable
                        .setValue(new VideoSharingSession(streamSession,
                            connectionFactory, to));
                } catch (InterruptedException e) {
View Full Code Here

Examples of de.zib.scalaris.ConnectionFactory

     *            number of threads to spawn for each existing Scalaris node
     * @param benchmarks
     *            the benchmarks to run (1-9 or -1 for all benchmarks)
     */
    public static void minibench(final int operations, final int threadsPerNode, final Set<Integer> benchmarks) {
        final ConnectionFactory cf = ConnectionFactory.getInstance();
        final List<PeerNode> nodes = cf.getNodes();
        final int parallelRuns = nodes.size();
        // set a connection policy that goes through the available nodes in a round-robin fashion:
        cf.setConnectionPolicy(new RoundRobinConnectionPolicy(nodes));
        System.out.println("Number of available nodes: " + nodes.size());
        System.out.println("-> Using " + parallelRuns + " parallel instances per test run...");
        long[][] results;
        String[] columns;
        String[] rows;
View Full Code Here

Examples of jade.imtp.leap.JICP.ConnectionFactory

* @author eduard
*/
public class NIOJICPSPeer extends NIOJICPPeer {

    public ConnectionFactory getConnectionFactory() {
        return new ConnectionFactory() {

            public Connection createConnection(Socket s) {
                return new NIOJICPSConnection();
            }

View Full Code Here

Examples of javax.jms.ConnectionFactory

  public static void main(String[] args) throws Exception {
    System.out.println("Subscribes and listens to the topic...");

    ictx = new InitialContext();
    Topic topic = (Topic) ictx.lookup("topic");
    ConnectionFactory tcf = (ConnectionFactory) ictx.lookup("tcf");
    ictx.close();

    Connection cnx = tcf.createConnection();
    Session session = cnx.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
    TopicSubscriber subscriber = session.createDurableSubscriber(topic, "durable");
    subscriber.setMessageListener(new MsgListener());

    cnx.start();
View Full Code Here

Examples of javax.jms.ConnectionFactory

 
  static Context ictx = null;

  public static void main(String[] args) throws Exception {
   
    ConnectionFactory cf = null;
    Topic dest = null;

    if (args.length != 1)
     throw new Exception("Bad number of argument");

    ictx = new InitialContext();
    try {
      if (args[0].equals("-")) {
        // Choose a connection factory and the associated topic depending of
        // the location property.
        cf = (ConnectionFactory) ictx.lookup("clusterCF");
        dest = (Topic) ictx.lookup("clusterTopic");
      } else {
        cf = (ConnectionFactory) ictx.lookup("cf" + args[0]);
        dest = (Topic) ictx.lookup("topic" + args[0]);
        System.setProperty("location", "server" + args[0]);
      }
    } finally {
      ictx.close();
    }

    Connection cnx = cf.createConnection("anonymous", "anonymous");
    Session session = cnx.createSession(true, 0);
    MessageProducer pub = session.createProducer(dest);

    String location = System.getProperty("location");
    if (location != null)
View Full Code Here

Examples of javax.jms.ConnectionFactory

  public static void main(String[] arg) throws Exception {
    System.out.println();
    System.out.println("Publishes messages on topic...");

    ConnectionFactory cf = HATcpConnectionFactory.create("hajoram://localhost:2560,localhost:2561,localhost:2562");
    ((HATcpConnectionFactory) cf).getParameters().connectingTimer = 30;

    AdminModule.connect(cf, "root", "root");

    Topic topic = Topic.create(0,"topic");

    AdminModule.disconnect();


    Connection cnx = cf.createConnection("anonymous", "anonymous");
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer pub = sess.createProducer(topic);

    TextMessage msg = sess.createTextMessage();
View Full Code Here

Examples of javax.jms.ConnectionFactory

  public static void main(String[] args) throws Exception {
    System.out.println("Trace1");

    ictx = new InitialContext();
    Queue queue = (Queue) ictx.lookup("receiveMailQueue");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    System.out.println("Trace2");

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer cons = sess.createConsumer(queue);

    System.out.println("Listens to the MailQueue...");
    System.out.println("hit a key to stop.");
View Full Code Here

Examples of javax.jms.ConnectionFactory

    System.out.println("Listens to the collector queue...");

    ictx = new InitialContext();
    Queue queue = (Queue) ictx.lookup("queue");
    // Topic topic = (Topic) ictx.lookup("topic");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer recv = sess.createConsumer(queue);
    // MessageConsumer subs = sess.createConsumer(topic);

    recv.setMessageListener(new MsgListener("Collector Queue listener"));
View Full Code Here

Examples of javax.jms.ConnectionFactory

 
  public static void main(String[] args) throws Exception {
    System.out.println("Monitoring administration...");

    javax.naming.Context jndiCtx = new javax.naming.InitialContext();
    ConnectionFactory cf = (ConnectionFactory) jndiCtx.lookup("cf");
   
    AdminModule.connect(cf, "root", "root");
   
    Properties topicProps = new Properties();
    topicProps.put("acquisition.className", "org.objectweb.joram.mom.dest.MonitoringAcquisition");
View Full Code Here

Examples of javax.jms.ConnectionFactory

    System.out.println();
    System.out.println("Listens to the monitoring topic...");

    Context ictx = new InitialContext();
    Topic topic = (Topic) ictx.lookup("MonitoringTopic");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer subs = sess.createConsumer(topic);

    subs.setMessageListener(new MonitorMsgListener());
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.