Exemplo n.º 1
0
  public void createQueue(
      final SimpleString address,
      final SimpleString name,
      final SimpleString filterString,
      final boolean temporary,
      final boolean durable)
      throws Exception {
    if (durable) {
      // make sure the user has privileges to create this queue
      securityStore.check(address, CheckType.CREATE_DURABLE_QUEUE, this);
    } else {
      securityStore.check(address, CheckType.CREATE_NON_DURABLE_QUEUE, this);
    }

    Queue queue = server.createQueue(address, name, filterString, durable, temporary);

    if (temporary) {
      // Temporary queue in core simply means the queue will be deleted if
      // the remoting connection
      // dies. It does not mean it will get deleted automatically when the
      // session is closed.
      // It is up to the user to delete the queue when finished with it

      TempQueueCleanerUpper cleaner = new TempQueueCleanerUpper(postOffice, name, queue);

      remotingConnection.addCloseListener(cleaner);
      remotingConnection.addFailureListener(cleaner);

      tempQueueCleannerUppers.put(name, cleaner);
    }
  }
Exemplo n.º 2
0
  public void createQueue(
      final SimpleString address,
      final SimpleString name,
      final SimpleString filterString,
      final boolean temporary,
      final boolean durable)
      throws Exception {
    if (durable) {
      // make sure the user has privileges to create this queue
      securityStore.check(address, CheckType.CREATE_DURABLE_QUEUE, this);
    } else {
      securityStore.check(address, CheckType.CREATE_NON_DURABLE_QUEUE, this);
    }

    Queue queue = server.createQueue(address, name, filterString, durable, temporary);

    if (temporary) {
      // Temporary queue in core simply means the queue will be deleted if
      // the remoting connection
      // dies. It does not mean it will get deleted automatically when the
      // session is closed.
      // It is up to the user to delete the queue when finished with it

      TempQueueCleanerUpper cleaner = new TempQueueCleanerUpper(server, name);

      remotingConnection.addCloseListener(cleaner);
      remotingConnection.addFailureListener(cleaner);

      tempQueueCleannerUppers.put(name, cleaner);
    }

    if (HornetQServerLogger.LOGGER.isDebugEnabled()) {
      HornetQServerLogger.LOGGER.debug(
          "Queue "
              + name
              + " created on address "
              + name
              + " with filter="
              + filterString
              + " temporary = "
              + temporary
              + " durable="
              + durable
              + " on session user="******", connection="
              + this.remotingConnection);
    }
  }
Exemplo n.º 3
0
  public ServerSessionImpl(
      final String name,
      final String username,
      final String password,
      final int minLargeMessageSize,
      final boolean autoCommitSends,
      final boolean autoCommitAcks,
      final boolean preAcknowledge,
      final boolean strictUpdateDeliveryCount,
      final boolean xa,
      final RemotingConnection remotingConnection,
      final StorageManager storageManager,
      final PostOffice postOffice,
      final ResourceManager resourceManager,
      final SecurityStore securityStore,
      final ManagementService managementService,
      final HornetQServer server,
      final SimpleString managementAddress,
      final SimpleString defaultAddress,
      final SessionCallback callback)
      throws Exception {
    this.username = username;

    this.password = password;

    this.minLargeMessageSize = minLargeMessageSize;

    this.autoCommitSends = autoCommitSends;

    this.autoCommitAcks = autoCommitAcks;

    this.preAcknowledge = preAcknowledge;

    this.remotingConnection = remotingConnection;

    this.storageManager = storageManager;

    this.postOffice = postOffice;

    this.resourceManager = resourceManager;

    this.securityStore = securityStore;

    timeoutSeconds = resourceManager.getTimeoutSeconds();
    this.xa = xa;

    this.strictUpdateDeliveryCount = strictUpdateDeliveryCount;

    this.managementService = managementService;

    this.name = name;

    this.server = server;

    this.managementAddress = managementAddress;

    this.callback = callback;

    this.defaultAddress = defaultAddress;

    remotingConnection.addFailureListener(this);

    if (!xa) {
      tx = newTransaction();
    }
  }