Examples of Bridge


Examples of org.jboss.jms.server.bridge.Bridge

      }                 
   }
  
   public void testStartBridgeWithJTATransactionAlreadyRunning() throws Exception
  
      Bridge bridge = null;
     
      Transaction toResume = null;
     
      Transaction started = null;
     
      TransactionManager mgr = TransactionManagerLocator.getInstance().locate();
                 
      try
      {
        
         toResume = mgr.suspend();
        
         mgr.begin();
        
         started = mgr.getTransaction();        
          
         final int NUM_MESSAGES = 10;
        
         bridge = new Bridge(cff0, cff1, sourceTopicFactory, targetQueueFactory,
                  null, null, null, null,
                  null, 5000, 10, Bridge.QOS_AT_MOST_ONCE,
                  1, -1,
                  null, null, false);
        
         bridge.start();
        
         this.sendMessages(cf0, sourceTopic, 0, NUM_MESSAGES, false);
           
         this.checkAllMessageReceivedInOrder(cf1, targetQueue, 0, NUM_MESSAGES);                         
      }
      finally
      {     
         if (started != null)
         {
            try
            {
               started.rollback();
            }
            catch (Exception e)
            {
               log.error("Failed to rollback", e);
            }
         }
        
         if (toResume != null)
         {
            try
            {
               mgr.resume(toResume);
            }
            catch (Exception e)
            {
               log.error("Failed to resume", e);
            }
         }        
         if (bridge != null)
         {
            bridge.stop();
         }    
      }                 
   }  
View Full Code Here

Examples of org.jboss.jms.server.bridge.Bridge

      }                 
   }  
  
   public void testNonDurableSubscriber() throws Exception
   {
      Bridge bridge = null;
           
      try
      {  
         final int NUM_MESSAGES = 10;
        
         bridge = new Bridge(cff0, cff1, sourceTopicFactory, targetQueueFactory,
                  null, null, null, null,
                  null, 5000, 10, Bridge.QOS_AT_MOST_ONCE,
                  1, -1,
                  null, null, false);
        
         bridge.start();
           
         sendMessages(cf0, sourceTopic, 0, NUM_MESSAGES, false);
        
         checkAllMessageReceivedInOrder(cf1, targetQueue, 0, NUM_MESSAGES);                   
      }
      finally
      {                       
         if (bridge != null)
         {
            bridge.stop();
         }
      }                 
   }
View Full Code Here

Examples of org.jboss.jms.server.bridge.Bridge

      }                 
   }
  
   public void testDurableSubscriber() throws Exception
   {
      Bridge bridge = null;
           
      try
      {
         final int NUM_MESSAGES = 10;
        
         bridge = new Bridge(cff0, cff1, sourceTopicFactory, targetQueueFactory,
                  null, null, null, null,
                  null, 5000, 10, Bridge.QOS_AT_MOST_ONCE,
                  1, -1,
                  "subTest", "clientid123", false);
        
         bridge.start();
           
         sendMessages(cf0, sourceTopic, 0, NUM_MESSAGES, true);
        
         checkAllMessageReceivedInOrder(cf1, targetQueue, 0, NUM_MESSAGES);             
      }
      finally
      {                     
         if (bridge != null)
         {
            bridge.stop();
         }
        
         //Now unsubscribe
         Connection conn = cf0.createConnection();
         conn.setClientID("clientid123");
View Full Code Here

Examples of org.midonet.client.resource.Bridge

        if (vm.getType() != VirtualMachine.Type.User) {
            return false;
        }

        // Get MidoNet bridge
        Bridge netBridge = getOrCreateNetworkBridge(network);

        // On bridge, get DHCP subnet (ensure it exists)
        ResourceCollection res = netBridge.getDhcpSubnets();

        DhcpSubnet sub = null;

        if(!res.isEmpty()){
            sub = (DhcpSubnet) res.get(0);
        } else {
            Pair<String,Integer> cidrInfo = NetUtils.getCidr(network.getCidr());
            sub = netBridge.addDhcpSubnet();

            sub.subnetLength(cidrInfo.second());
            sub.subnetPrefix(cidrInfo.first());
            sub.defaultGateway(network.getGateway());
            List<String> dcs = new ArrayList<String>();
View Full Code Here

Examples of org.mule.construct.Bridge

public class BridgeBuilderTestCase extends AbstractMuleTestCase
{
    public void testFullConfiguration() throws Exception
    {
        Bridge bridge = new BridgeBuilder().name("test-bridge-full")
            .inboundAddress("test://foo.in")
            .transformers(new StringAppendTransformer("bar"))
            .responseTransformers(new ObjectToByteArray(), new GZipCompressTransformer())
            .outboundAddress("test://foo.out")
            .exchangePattern(MessageExchangePattern.REQUEST_RESPONSE)
            .transacted(false)
            .exceptionStrategy(new DefaultMessagingExceptionStrategy(muleContext, true))
            .build(muleContext);

        assertEquals("test-bridge-full", bridge.getName());
    }
View Full Code Here

Examples of org.xulfaces.bridge.Bridge

  }

  public static Bridge getBridge(){
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{bridge}");
    Bridge bridge = (Bridge) valueBinding.getValue(facesContext);
    return bridge;
  }
View Full Code Here

Examples of org.xulfaces.bridge.Bridge

      throws IOException {
    super.encodeBegin(facesContext, component);
    if (component instanceof EditableValueHolder) {
      EditableValueHolder editableValueHolder = (EditableValueHolder) component;
      if (!editableValueHolder.isValid()) {
        Bridge bridge = XulUtils.getBridge();
        Zone zone = new Zone(component.getClientId(facesContext));
        bridge.addCommand(new NotValidCommand(zone));
      }
    }
  }
View Full Code Here

Examples of org.xulfaces.bridge.Bridge

  private void renderXFC(FacesContext facesContext,
      BridgeComponent bridgeComponent) throws IOException {

    ResponseWriter responseWriter = facesContext.getResponseWriter();
    Bridge bridge = XulUtils.getBridge();
    responseWriter.startElement("xfc:bridge", bridgeComponent);
    for (Command command : bridge.getCommands()) {
      StringBuffer stringBuffer = new StringBuffer("xfc:");
      stringBuffer.append(command.getName());

      if (log.isDebugEnabled()) {
        log.debug("Command " + stringBuffer.toString() + " on "
            + command.getTarget());
      }

      responseWriter.startElement(stringBuffer.toString(),
          bridgeComponent);
      for (Parameter parameter : command.getParameters()) {

        if (log.isDebugEnabled()) {
          log.debug("parameter " + parameter.getName() + " value "
              + parameter.getValue());
        }

        responseWriter.writeAttribute(parameter.getName(), parameter
            .getValue().toString(), null);
      }
      responseWriter.endElement(stringBuffer.toString());
    }

    facesContext.getApplication().getViewHandler().writeState(facesContext);

    responseWriter.endElement("xfc:bridge");
    bridge.getCommands().clear();
  }
View Full Code Here

Examples of org.xulfaces.bridge.Bridge

    // the bridge for client side update. The parent will be updated and then all its children.
    if(!isParentSmoothlyUpdateable(component)){   
      if (component instanceof SmoothlyUpdateable) {
        SmoothlyUpdateable smoothlyUpdateable = (SmoothlyUpdateable) component;
        if (smoothlyUpdateable.needsUpdate()) {
          Bridge bridge = XulUtils.getBridge();
          Zone zone = new Zone(component.getClientId(facesContext));
          if (log.isDebugEnabled()) {
            log.debug("Add UpdateZoneCommand for DOM zone " + zone.getNodeId());
          }
         
          bridge.addCommand(new UpdateZoneCommand(zone,buildTargetName(component)));
        }
      }
    }
  }
View Full Code Here

Examples of org.xulfaces.bridge.Bridge

    responseWriter.writeAttribute("id",treeRowComponent.getNodeId(), "id");
    if(!isParentSmoothlyUpdateable(component)){
      if (component instanceof SmoothlyUpdateable) {
        SmoothlyUpdateable smoothlyUpdateable = (SmoothlyUpdateable) component;
        if (smoothlyUpdateable.needsUpdate()) {
          Bridge bridge = XulUtils.getBridge();
          Zone zone = new Zone(treeRowComponent.getNodeId());
          bridge.addCommand(new UpdateZoneCommand(zone,buildTargetName(component)));
        }
      }
    }
   
    renderAttributes(facesContext, component, (List) component
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.