Tabnine Logo
Broker.addDestination
Code IndexAdd Tabnine to your IDE (free)

How to use
addDestination
method
in
org.apache.activemq.broker.Broker

Best Java code snippets using org.apache.activemq.broker.Broker.addDestination (Showing top 20 results out of 315)

origin: apache/activemq

@Override
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception {
  Destination result = next.addDestination(context, destination,createIfTemporary);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addDestination(context, destination,createIfTemporary);
  }
  return result;
}
origin: apache/activemq

@Override
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception {
  return getNext().addDestination(context, destination,createIfTemporary);
}
origin: apache/activemq

/**
 * Looks up and lazily creates if necessary the destination for the given
 * JMS name
 */
public Destination getDestination(ActiveMQDestination destination) throws Exception {
  return getBroker().addDestination(getAdminConnectionContext(), destination,false);
}
origin: apache/activemq

protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception {
  Destination dest = null;
  destinationsLock.readLock().lock();
  try {
    dest = destinations.get(destination);
  } finally {
    destinationsLock.readLock().unlock();
  }
  if (dest == null) {
    if (isAutoCreateDestinations()) {
      // Try to auto create the destination... re-invoke broker
      // from the
      // top so that the proper security checks are performed.
      dest = context.getBroker().addDestination(context, destination, createTemporary);
    }
    if (dest == null) {
      throw new JMSException("The destination " + destination + " does not exist.");
    }
  }
  return dest;
}
origin: apache/activemq

protected void importDestinations() throws Exception {
  BufferedReader reader = null;
  try {
    if (location.exists()) {
      reader = new BufferedReader(new FileReader(location));
      String destination;
      Broker broker = getBrokerService().getBroker();
      while ((destination = reader.readLine()) != null) {
        broker.addDestination(getBrokerService().getAdminConnectionContext(),
            ActiveMQDestination.createDestination(destination, ActiveMQDestination.QUEUE_TYPE),
            true);
      }
    }
  } catch (Exception e) {
    LOG.warn("Exception loading destinations", e);
  }  finally {
    if (reader != null) {
      reader.close();
    }
  }
}
origin: apache/activemq

@Override
public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception {
  ActiveMQDestination destination = info.getDestination();
  if (destination != null) {
    inactiveDestinationsPurgeLock.readLock().lock();
    try {
      // This seems to cause the destination to be added but without
      // advisories firing...
      context.getBroker().addDestination(context, destination, isAllowTempAutoCreationOnSend());
      getRegion(destination).addProducer(context, info);
    } finally {
      inactiveDestinationsPurgeLock.readLock().unlock();
    }
  }
}
origin: apache/activemq

@Override
public final void start() throws Exception {
  started = true;
  Set<ActiveMQDestination> inactiveDests = getInactiveDestinations();
  for (Iterator<ActiveMQDestination> iter = inactiveDests.iterator(); iter.hasNext();) {
    ActiveMQDestination dest = iter.next();
    ConnectionContext context = new ConnectionContext();
    context.setBroker(broker.getBrokerService().getBroker());
    context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT);
    context.getBroker().addDestination(context, dest, false);
  }
  destinationsLock.readLock().lock();
  try{
    for (Iterator<Destination> i = destinations.values().iterator(); i.hasNext();) {
      Destination dest = i.next();
      dest.start();
    }
  } finally {
    destinationsLock.readLock().unlock();
  }
}
origin: apache/activemq

protected void startVirtualConsumerDestinations() throws Exception {
  checkStartException();
  ConnectionContext adminConnectionContext = getAdminConnectionContext();
  Set<ActiveMQDestination> destinations = destinationFactory.getDestinations();
  DestinationFilter filter = getVirtualTopicConsumerDestinationFilter();
  if (!destinations.isEmpty()) {
    for (ActiveMQDestination destination : destinations) {
      if (filter.matches(destination) == true) {
        broker.addDestination(adminConnectionContext, destination, false);
      }
    }
  }
}
origin: apache/activemq

/**
 * Starts any configured destinations on startup
 */
protected void startDestinations() throws Exception {
  if (destinations != null) {
    ConnectionContext adminConnectionContext = getAdminConnectionContext();
    for (int i = 0; i < destinations.length; i++) {
      ActiveMQDestination destination = destinations[i];
      getBroker().addDestination(adminConnectionContext, destination,true);
    }
  }
  if (isUseVirtualTopics()) {
    startVirtualConsumerDestinations();
  }
}
origin: apache/activemq

@Override
public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception {
  if (destination.isQueue() && destination.isPattern()) {
    DestinationFilter filter = DestinationFilter.parseFilter(new ActiveMQQueue(prefix + DestinationFilter.ANY_DESCENDENT));
    if (filter.matches(destination)) {
      broker.addDestination(context, destination, false);
    }
  }
}
origin: apache/activemq

@Override
public void addQueue(String name) throws Exception {
  safeGetBroker().getContextBroker()
    .addDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQQueue(name), true);
}
origin: apache/activemq

@Override
public void addTopic(String name) throws Exception {
  safeGetBroker().getContextBroker()
    .addDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQTopic(name), true);
}
origin: apache/activemq

@Override
public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception {
  ActiveMQDestination destination = message.getDestination();
  message.setBrokerInTime(System.currentTimeMillis());
  if (producerExchange.isMutable() || producerExchange.getRegion() == null
    || (producerExchange.getRegionDestination() != null && producerExchange.getRegionDestination().isDisposed())) {
    // ensure the destination is registered with the RegionBroker
    producerExchange.getConnectionContext().getBroker()
      .addDestination(producerExchange.getConnectionContext(), destination, isAllowTempAutoCreationOnSend());
    producerExchange.setRegion(getRegion(destination));
    producerExchange.setRegionDestination(null);
  }
  producerExchange.getRegion().send(producerExchange, message);
  // clean up so these references aren't kept (possible leak) in the producer exchange
  // especially since temps are transitory
  if (producerExchange.isMutable()) {
    producerExchange.setRegionDestination(null);
    producerExchange.setRegion(null);
  }
}
origin: org.apache.activemq/activemq-all

@Override
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception {
  Destination result = next.addDestination(context, destination,createIfTemporary);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addDestination(context, destination,createIfTemporary);
  }
  return result;
}
origin: org.apache.activemq/activemq-broker

@Override
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception {
  Destination result = next.addDestination(context, destination,createIfTemporary);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].addDestination(context, destination,createIfTemporary);
  }
  return result;
}
origin: org.apache.activemq/activemq-broker

@Override
public Destination addDestination(ConnectionContext context, ActiveMQDestination destination,boolean createIfTemporary) throws Exception {
  return getNext().addDestination(context, destination,createIfTemporary);
}
origin: org.apache.activemq/activemq-broker

/**
 * Looks up and lazily creates if necessary the destination for the given
 * JMS name
 */
public Destination getDestination(ActiveMQDestination destination) throws Exception {
  return getBroker().addDestination(getAdminConnectionContext(), destination,false);
}
origin: org.apache.activemq/activemq-broker

@Override
public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception {
  if (destination.isQueue() && destination.isPattern()) {
    DestinationFilter filter = DestinationFilter.parseFilter(new ActiveMQQueue(prefix + DestinationFilter.ANY_DESCENDENT));
    if (filter.matches(destination)) {
      broker.addDestination(context, destination, false);
    }
  }
}
origin: org.apache.activemq/activemq-broker

@Override
public void addTopic(String name) throws Exception {
  safeGetBroker().getContextBroker()
    .addDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQTopic(name), true);
}
origin: org.apache.activemq/activemq-broker

@Override
public void addQueue(String name) throws Exception {
  safeGetBroker().getContextBroker()
    .addDestination(BrokerSupport.getConnectionContext(safeGetBroker().getContextBroker()), new ActiveMQQueue(name), true);
}
org.apache.activemq.brokerBrokeraddDestination

Javadoc

Add and process a DestinationInfo object

Popular methods of Broker

  • getAdaptor
    Get a Broker from the Broker Stack that is a particular class
  • getDestinationMap
    return a reference destination map of a region based on the destination type
  • removeDestination
  • commitTransaction
    Commits a transaction.
  • forgetTransaction
    Forgets a transaction.
  • getBrokerService
  • getClients
  • getDestinations
  • getPreparedTransactions
    Gets a list of all the prepared xa transactions.
  • getVmConnectorURI
  • removeConsumer
  • acknowledge
  • removeConsumer,
  • acknowledge,
  • addBroker,
  • addConnection,
  • addConsumer,
  • addDestinationInfo,
  • addProducer,
  • addSession,
  • beginTransaction

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JCheckBox (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now