Package com.opengamma.util.jms

Examples of com.opengamma.util.jms.JmsConnector


  public static JmsLiveDataClient getJmsClient(StandardLiveDataServer server) {
    ByteArrayFudgeRequestSender subscriptionRequestSender = getSubscriptionRequestSender(server);
    ByteArrayFudgeRequestSender entitlementRequestSender = getEntitlementRequestSender(server);
   
    JmsConnector jmsConnector = ActiveMQTestUtils.createTestJmsConnector();
    JmsLiveDataClient liveDataClient = new JmsLiveDataClient(
        subscriptionRequestSender,
        entitlementRequestSender,
        jmsConnector);
   
View Full Code Here


  private MarketDataDistributor _mdd;
  private JmsSenderFactory _factory;

  @BeforeClass
  public void setUpClass() {
    JmsConnector jmsConnector = ActiveMQTestUtils.createTestJmsConnector();
   
    _factory = new JmsSenderFactory(jmsConnector);
    _mdd = MarketDataDistributorTest.getTestDistributor(_factory);
   
    _collectingReceiver = new CollectingByteArrayMessageReceiver();
    JmsByteArrayMessageDispatcher messageDispatcher = new JmsByteArrayMessageDispatcher(_collectingReceiver);
   
    _container = new DefaultMessageListenerContainer();
    _container.setConnectionFactory(jmsConnector.getConnectionFactory());
    _container.setMessageListener(messageDispatcher);
    _container.setDestinationName(_mdd.getDistributionSpec().getJmsTopic());
    _container.setPubSubDomain(true);
    _container.afterPropertiesSet();
    _container.start();
View Full Code Here

    JmsConnectorFactoryBean jmsConnectorFactoryBean = new JmsConnectorFactoryBean();
    jmsConnectorFactoryBean.setConnectionFactory(activeMQConnectionFactory);
    jmsConnectorFactoryBean.setName("Masters");

    JmsConnector jmsConnector = jmsConnectorFactoryBean.getObjectCreating();
    ScheduledExecutorService heartbeatScheduler = Executors.newSingleThreadScheduledExecutor();
    try {
      ViewProcessor vp = new RemoteViewProcessor(
          vpBase,
          jmsConnector,
View Full Code Here

    final LiveDataMetaData metaData = provider.metaData();
    final URI jmsUri = metaData.getJmsBrokerUri();
    if (metaData.getServerType() != LiveDataServerTypes.STANDARD || jmsUri == null) {
      throw new IllegalStateException();
    }
    JmsConnector jmsConnector = getJmsConnector();
    if (jmsConnector.getClientBrokerUri().equals(jmsUri) == false) {
      final JmsConnectorFactoryBean jmsFactory = new JmsConnectorFactoryBean(jmsConnector);
      jmsFactory.setClientBrokerUri(jmsUri);
      jmsConnector = jmsFactory.getObjectCreating();
    }
View Full Code Here

    URI jmsUri = metaData.getJmsBrokerUri();
    if (metaData.getServerType() != LiveDataServerTypes.STANDARD || jmsUri == null) {
      s_logger.warn("Unsupported live data server type " + metaData.getServerType() + " for " + metaData.getDescription() + " live data provider. This provider will not be available.");
      return null;
    }
    JmsConnector jmsConnector = getJmsConnector();
    if (!jmsConnector.getClientBrokerUri().equals(jmsUri)) {
      JmsConnectorFactoryBean jmsFactory = new JmsConnectorFactoryBean(jmsConnector);
      jmsFactory.setClientBrokerUri(jmsUri);
      jmsConnector = jmsFactory.getObjectCreating();
    }
   
View Full Code Here

    ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(jmsBrokerUri);
    JmsConnectorFactoryBean factory = new JmsConnectorFactoryBean();
    factory.setName(getClass().getSimpleName());
    factory.setConnectionFactory(cf);
    factory.setClientBrokerUri(jmsBrokerUri);
    JmsConnector jmsConnector = factory.getObjectCreating();
   
    URI uri = UriBuilder.fromUri(info.getUri()).build();
   
    return new RemoteViewProcessor(uri, jmsConnector, _scheduler);
  }
View Full Code Here

    final ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(uri);
    final JmsConnectorFactoryBean factory = new JmsConnectorFactoryBean();
    factory.setName("WatchListRecorder");
    factory.setConnectionFactory(cf);
    factory.setClientBrokerUri(uri);
    final JmsConnector jmsConnector = factory.getObjectCreating();

    final ViewProcessor viewProcessor = new RemoteViewProcessor(viewProcessorInfo.getUri(), jmsConnector, Executors.newSingleThreadScheduledExecutor());
    // TODO: Not ideal; the published resolver should be used rather than an ad-hoc one created based just on the security source
    final ComputationTargetResolver targetResolver = new DefaultComputationTargetResolver(new RemoteSecuritySource(securitySourceInfo.getUri()));
    return new WatchListRecorder(viewProcessor, targetResolver);
View Full Code Here

            s_logger.warn("Unable to populate tool context '" + metaProperty.name() +
                "', no appropriate component found on the server");
            continue;
          }
          if (ViewProcessor.class.equals(componentInfo.getType())) {
            final JmsConnector jmsConnector = createJmsConnector(componentInfo);
            final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("rvp"));
            ViewProcessor vp = new RemoteViewProcessor(componentInfo.getUri(), jmsConnector, scheduler);
            toolContext.setViewProcessor(vp);
            toolContext.setContextManager(new Closeable() {
              @Override
              public void close() throws IOException {
                scheduler.shutdownNow();
                jmsConnector.close();
              }
            });
          } else {
            String clazzName = componentInfo.getAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA);
            if (clazzName == null) {
View Full Code Here

 
  //-------------------------------------------------------------------------
  public RemoteViewProcessor getViewProcessor(String vpId) {
    ComponentInfo info = getComponentServer().getComponentInfo(ViewProcessor.class, "main");
    URI uri = info.getUri();
    JmsConnector jmsConnector = getJmsConnector(info);
    return new RemoteViewProcessor(uri, jmsConnector, Executors.newSingleThreadScheduledExecutor());
  }
View Full Code Here

  public List<RemoteViewProcessor> getViewProcessors() {
    List<RemoteViewProcessor> result = new ArrayList<RemoteViewProcessor>();
    for (ComponentInfo info : getComponentServer().getComponentInfos(ViewProcessor.class)) {
      URI uri = info.getUri();
      JmsConnector jmsConnector = getJmsConnector(info);
      RemoteViewProcessor vp = new RemoteViewProcessor(uri, jmsConnector, Executors.newSingleThreadScheduledExecutor());
      result.add(vp);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.util.jms.JmsConnector

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.