Examples of LinkImpl


Examples of org.apache.qpid.proton.engine.impl.LinkImpl

         write();
         session = protonConnection.sessionHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
      }

      //handle new link (producer or consumer
      LinkImpl link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
      while (link != null)
      {
         try
         {
            protonProtocolManager.handleNewLink(link, getSession(link.getSession()));
         }
         catch (HornetQAMQPException e)
         {
            link.setLocalError(new EndpointError(e.getAmqpError(), e.getMessage()));
            link.close();
         }
         link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
      }

      //handle any deliveries
      DeliveryImpl delivery;

      Iterator<DeliveryImpl> iterator = protonConnection.getWorkSequence();

      while (iterator.hasNext())
      {
         delivery = iterator.next();
         ProtonDeliveryHandler handler = (ProtonDeliveryHandler) delivery.getLink().getContext();
         try
         {
            handler.onMessage(delivery);
         }
         catch (HornetQAMQPException e)
         {
            delivery.getLink().setLocalError(new EndpointError(e.getAmqpError(), e.getMessage()));
         }
      }

      link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.ANY_ENDPOINT_STATE);
      while (link != null)
      {
         try
         {
            protonProtocolManager.handleActiveLink(link);
         }
         catch (HornetQAMQPException e)
         {
            link.setLocalError(new EndpointError(e.getAmqpError(), e.getMessage()));
         }
         link = (LinkImpl) link.next(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.ANY_ENDPOINT_STATE);
      }

      link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.CLOSED);
      while (link != null)
      {
         try
         {
            ((ProtonDeliveryHandler) link.getContext()).close();
         }
         catch (HornetQAMQPException e)
         {
            link.setLocalError(new EndpointError(e.getAmqpError(), e.getMessage()));
         }
         link.close();

         link = (LinkImpl) link.next(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.CLOSED);
      }

      session = protonConnection.sessionHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.CLOSED);
      while (session != null)
      {
View Full Code Here

Examples of org.apache.qpid.proton.engine.impl.LinkImpl

            write();
            session = protonConnection.sessionHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
         }

         //handle new link (producer or consumer
         LinkImpl link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
         while (link != null)
         {
            try
            {
               protonProtocolManager.handleNewLink(link, getSession(link.getSession()));
            }
            catch (HornetQAMQPException e)
            {
               link.setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
               link.close();
            }
            link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
         }

         //handle any deliveries
         DeliveryImpl delivery;

         Iterator<DeliveryImpl> iterator = protonConnection.getWorkSequence();

         while (iterator.hasNext())
         {
            delivery = iterator.next();
            ProtonDeliveryHandler handler = (ProtonDeliveryHandler) delivery.getLink().getContext();
            try
            {
               handler.onMessage(delivery);
            }
            catch (HornetQAMQPException e)
            {
               delivery.getLink().setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
            }
         }

         link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.ANY_ENDPOINT_STATE);
         while (link != null)
         {
            try
            {
               protonProtocolManager.handleActiveLink(link);
            }
            catch (HornetQAMQPException e)
            {
               link.setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
            }
            link = (LinkImpl) link.next(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.ANY_ENDPOINT_STATE);
         }

         link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.CLOSED);
         while (link != null)
         {
            try
            {
               ((ProtonDeliveryHandler) link.getContext()).close();
            }
            catch (HornetQAMQPException e)
            {
               link.setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
            }
            link.close();

            link = (LinkImpl) link.next(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.CLOSED);
         }

         session = protonConnection.sessionHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.CLOSED);
         while (session != null)
         {
View Full Code Here

Examples of org.apache.tapestry5.internal.services.LinkImpl

    @Inject
    private Response _response;
   

    Link onActivate() throws ServletException, IOException {
        return new LinkImpl(SecurityConstants.J_LOGOUT, true, false, _response, _optimizer);
    }
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

    GameEngine.instance().getBoardMaps().remove("Auckland");
  }
 
  @Test//TODO add description here
  public final void testEqualsObject() throws GameException{
    Link other = new LinkImpl(boardMap, TransportationMethod.BUS, a, b);
    Assert.assertTrue(link.equals(other));
    Link other2 = new LinkImpl(boardMap, TransportationMethod.TAXI, a, b);
    Assert.assertFalse(link.equals(other2));
    Link other3 = new LinkImpl(boardMap, TransportationMethod.BUS, a, new CoordinateImpl(boardMap,11,22));
    Assert.assertFalse(link.equals(other3));
    Link other4 = new LinkImpl(boardMap, TransportationMethod.BUS, new CoordinateImpl(boardMap,11,20), b);
    Assert.assertFalse(link.equals(other4));
  }
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

    Assert.assertEquals(link.getBoardMap(), boardMap);
  }

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl2() throws Exception{
    Assert.assertNull(new LinkImpl(
        null,
        TransportationMethod.BUS,
        new CoordinateImpl(boardMap, 2, 2),
        new CoordinateImpl(boardMap, 1, 1)
    ));
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

   
  }

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl3() throws Exception{
    Assert.assertNull(new LinkImpl(
        boardMap,
        null,
        new CoordinateImpl(boardMap, 2, 2),
        new CoordinateImpl(boardMap, 1, 1)
    ));
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

   
  }

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl4() throws Exception{
    Assert.assertNull(new LinkImpl(
        boardMap,
        TransportationMethod.BUS,
        null,
        new CoordinateImpl(boardMap, 1, 1)
    ));
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

    ));
  }

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl5() throws Exception{
    Assert.assertNull(new LinkImpl(
        boardMap,
        TransportationMethod.BUS,
        new CoordinateImpl(boardMap, 2, 2),
        null
    ));
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

    ));
  }

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl6() throws Exception{
    Assert.assertNull(new LinkImpl(
        boardMap,
        TransportationMethod.BUS,
        new CoordinateImpl(boardMap, 12, 22),
        new CoordinateImpl(boardMap2, 12, 22)
    ));
View Full Code Here

Examples of org.scotlandyard.impl.engine.boardmap.LinkImpl

    ));
  }

  @Test(expected=Exception.class)//TODO add description here
  public final void testLinkImpl7() throws Exception{
    Assert.assertNull(new LinkImpl(
        boardMap,
        TransportationMethod.BUS,
        new CoordinateImpl(boardMap2, 12, 22),
        new CoordinateImpl(boardMap, 12, 22)
    ));
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.