Package com.nokia.dempsy.config

Examples of com.nokia.dempsy.config.ApplicationDefinition


      onodes = System.setProperty("min_nodes_for_cluster", "1");
      oslots = System.setProperty("total_slots_for_cluster", "20");

      final ClusterId clusterId = new ClusterId("test", "test-slot");
      Destination destination = new Destination() {};
      ApplicationDefinition app = new ApplicationDefinition(clusterId.getApplicationName());
      DecentralizedRoutingStrategy strategy = new DecentralizedRoutingStrategy(1, 1);
      app.setRoutingStrategy(strategy);
      app.setSerializer(new JavaSerializer<Object>());
      ClusterDefinition cd = new ClusterDefinition(clusterId.getMpClusterName());
      cd.setMessageProcessorPrototype(new GoodTestMp());
      app.add(cd);
      app.initialize();
     
      LocalClusterSessionFactory mpfactory = new LocalClusterSessionFactory();
      ClusterInfoSession session = mpfactory.createSession();
     
      TestUtils.createClusterLevel(clusterId, session);
View Full Code Here


      ctx[0] = "fullApp/Dempsy-FullUp.xml";
      Map<ClusterId,DempsyHolder> dempsys = new HashMap<ClusterId,DempsyHolder>();

      try
      {
         ApplicationDefinition ad = new FullApplication().getTopology();
         ad.initialize();

         List<ClusterDefinition> clusters = ad.getClusterDefinitions();
         for (int i = clusters.size() - 1; i >= 0; i--)
         {
            ClusterDefinition cluster = clusters.get(i);
            CheckCluster.toCheckAgainst = cluster.getClusterId();
View Full Code Here

      Map<ClusterId,DempsyHolder> dempsys = new HashMap<ClusterId,DempsyHolder>();
      DempsyHolder spare = new DempsyHolder();

      try
      {
         ApplicationDefinition ad = new FullApplication().getTopology();
         ad.initialize();

         List<ClusterDefinition> clusters = ad.getClusterDefinitions();
         for (int i = clusters.size() - 1; i >= 0; i--)
         {
            ClusterDefinition cluster = clusters.get(i);
            CheckCluster.toCheckAgainst = cluster.getClusterId();
View Full Code Here

public class TestRouterInstantiation
{
   @Test
   public void testGetMessages() throws Throwable
   {
      ApplicationDefinition app = new ApplicationDefinition("test");
      Router router = new Router(app);

      List<Object> messages = new ArrayList<Object>();
      Object first = new Object();
      router.getMessages(first, messages);
View Full Code Here

   }
  
   @Test
   public void testDispatchBadMessage() throws Throwable
   {
      ApplicationDefinition app = new ApplicationDefinition("test");
      Router router = new Router(app);

      Object o;
      router.dispatch(o = new Object() {
         @MessageKey
View Full Code Here

   }

   @Test
   public void testGetMessagesNester() throws Throwable
   {
      ApplicationDefinition app = new ApplicationDefinition("test");
      Router router = new Router(app);
     
      List<Object> messages = new ArrayList<Object>();
      List<Object> parent = new ArrayList<Object>();
      List<Object> nested = new ArrayList<Object>();
View Full Code Here

      }
   }
  
   public ApplicationDefinition getTopology() throws DempsyException
   {
      ApplicationDefinition ret = new ApplicationDefinition(FullApplication.class.getSimpleName()).
            add(new ClusterDefinition(MyAdaptor.class.getSimpleName()).setAdaptor(new MyAdaptor())).
            add(new ClusterDefinition(MyMp.class.getSimpleName()).setMessageProcessorPrototype(new MyMp()).setOutputExecuter(new RelativeOutputSchedule(1, TimeUnit.SECONDS))).
            add(new ClusterDefinition(MyRankMp.class.getSimpleName()).setMessageProcessorPrototype(new MyRankMp()));
     
      return ret;
View Full Code Here

            };
         };
         sessionRef.set(session);

         final FullApplication app = new FullApplication();
         ApplicationDefinition ad = app.getTopology();

         assertEquals(0,processCount.intValue()); // no calls yet

         dempsy[0] = getDempsyFor(new ClusterId(FullApplication.class.getSimpleName(),FullApplication.MyAdaptor.class.getSimpleName()),ad);
         dempsy[0].setClusterSessionFactory(new ZookeeperSessionFactory("127.0.0.1:" + port,5000));
View Full Code Here

TOP

Related Classes of com.nokia.dempsy.config.ApplicationDefinition

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.