⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 destination.java

📁 一个类似于openJMS分布在ObjectWeb之下的JMS消息中间件。
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
  /**   * Admin method unsetting free writing access to this destination.   * <p>   * The request fails if this destination is deleted server side.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public void unsetFreeWriting() throws ConnectException, AdminException    {      AdminModule.doRequest(new UnsetWriter(null, getName()));    }  /**   * Admin method setting a given user as a reader on this destination.   * <p>   * The request fails if this destination is deleted server side.   *   * @param user  User to be set as a reader.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public void setReader(User user) throws ConnectException, AdminException    {      AdminModule.doRequest(new SetReader(user.getProxyId(), getName()));    }  /** used by MBean jmx */  public void addReader(String proxyId)    throws ConnectException, AdminException {    AdminModule.doRequest(new SetReader(proxyId, getName()));  }  /**   * Admin method setting a given user as a writer on this destination.   * <p>   * The request fails if this destination is deleted server side.   *   * @param user  User to be set as a writer.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public void setWriter(User user) throws ConnectException, AdminException    {      AdminModule.doRequest(new SetWriter(user.getProxyId(), getName()));    }  /** used by MBean jmx */  public void addWriter(String proxyId)    throws ConnectException, AdminException {    AdminModule.doRequest(new SetWriter(proxyId, getName()));  }  /**   * Admin method unsetting a given user as a reader on this destination.   * <p>   * The request fails if this destination is deleted server side.   *   * @param user  Reader to be unset.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public void unsetReader(User user)    throws ConnectException, AdminException {    AdminModule.doRequest(new UnsetReader(user.getProxyId(), getName()));  }  /** used by MBean jmx */  public void removeReader(String proxyId)    throws ConnectException, AdminException {    AdminModule.doRequest(new UnsetReader(proxyId, getName()));  }  /**   * Admin method unsetting a given user as a writer on this destination.   * <p>   * The request fails if this destination is deleted server side.   *   * @param user  Writer to be unset.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public void unsetWriter(User user)    throws ConnectException, AdminException {    AdminModule.doRequest(new UnsetWriter(user.getProxyId(), getName()));  }  /** used by MBean jmx */  public void removeWriter(String proxyId)    throws ConnectException, AdminException {    AdminModule.doRequest(new UnsetWriter(proxyId, getName()));  }  /**   * Admin method setting or unsetting a dead message queue for this   * destination.   * <p>   * The request fails if this destination is deleted server side.   *   * @param dmq  The dead message queue to be set (<code>null</code> for   *             unsetting current DMQ).   *   * @exception IllegalArgumentException  If the DMQ is not a valid   *              JORAM destination.   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public void setDMQ(DeadMQueue dmq) throws ConnectException, AdminException    {      if (dmq == null)        AdminModule.doRequest(new UnsetDestinationDMQ(getName()));      else        AdminModule.doRequest(new SetDestinationDMQ(getName(), dmq.getName()));    }  /**   * Monitoring method returning the list of all users that have a reading   * permission on this destination, or an empty list if no specific readers   * are set.   * <p>   * The request fails if the destination is deleted server side.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public List getReaders() throws ConnectException, AdminException    {      Monitor_GetReaders request = new Monitor_GetReaders(getName());      Monitor_GetUsersRep reply =        (Monitor_GetUsersRep) AdminModule.doRequest(request);      Vector list = new Vector();      Hashtable users = reply.getUsers();      String name;      for (Enumeration names = users.keys(); names.hasMoreElements();) {        name = (String) names.nextElement();        list.add(new User(name, (String) users.get(name)));      }      return list;    }  /** used by MBean jmx */  public List getReaderList() throws ConnectException, AdminException {    Vector list = new Vector();    List readers = getReaders();    for (ListIterator iterator = readers.listIterator(); iterator.hasNext(); ) {      list.add(iterator.next().toString());    }    return list;  }  /**   * Monitoring method returning the list of all users that have a writing   * permission on this destination, or an empty list if no specific writers   * are set.   * <p>   * The request fails if the destination is deleted server side.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public List getWriters() throws ConnectException, AdminException    {      Monitor_GetWriters request = new Monitor_GetWriters(getName());      Monitor_GetUsersRep reply =        (Monitor_GetUsersRep) AdminModule.doRequest(request);      Vector list = new Vector();      Hashtable users = reply.getUsers();      String name;      for (Enumeration names = users.keys(); names.hasMoreElements();) {        name = (String) names.nextElement();        list.add(new User(name, (String) users.get(name)));      }      return list;    }  /** used by MBean jmx */  public List getWriterList() throws ConnectException, AdminException {    Vector list = new Vector();    List readers = getWriters();    for (ListIterator iterator = readers.listIterator(); iterator.hasNext(); ) {      list.add(iterator.next().toString());    }    return list;  }  /**   * Monitoring method returning <code>true</code> if this destination   * provides free READ access.   * <p>   * The request fails if the destination is deleted server side.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public boolean isFreelyReadable() throws ConnectException, AdminException    {      Monitor_GetFreeAccess request = new Monitor_GetFreeAccess(getName());      Monitor_GetFreeAccessRep reply;      reply = (Monitor_GetFreeAccessRep) AdminModule.doRequest(request);      return reply.getFreeReading();    }  /** used by MBean */  public void setFreelyReadable(boolean b)    throws ConnectException, AdminException {    if (b)      setFreeReading();    else      unsetFreeReading();  }  /**   * Monitoring method returning <code>true</code> if this destination   * provides free WRITE access.   * <p>   * The request fails if the destination is deleted server side.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public boolean isFreelyWriteable() throws ConnectException, AdminException    {      Monitor_GetFreeAccess request = new Monitor_GetFreeAccess(getName());      Monitor_GetFreeAccessRep reply;      reply = (Monitor_GetFreeAccessRep) AdminModule.doRequest(request);      return reply.getFreeWriting();    }  /** used by MBean */  public void setFreelyWriteable(boolean b)    throws ConnectException, AdminException {    if (b)      setFreeWriting();    else      unsetFreeWriting();  }  /**   * Monitoring method returning the dead message queue of this destination,   * null if not set.   * <p>   * The request fails if the destination is deleted server side.   *   * @exception ConnectException  If the admin connection is closed or broken.   * @exception AdminException  If the request fails.   */  public DeadMQueue getDMQ() throws ConnectException, AdminException    {      Monitor_GetDMQSettings request = new Monitor_GetDMQSettings(getName());      Monitor_GetDMQSettingsRep reply;      reply = (Monitor_GetDMQSettingsRep) AdminModule.doRequest(request);      if (reply.getDMQName() == null) {        return null;      } else {        return new DeadMQueue(reply.getDMQName());      }    }  public static Destination newInstance(    String id,    String name,    String type) throws AdminException {    if (JoramTracing.dbgClient.isLoggable(BasicLevel.DEBUG))      JoramTracing.dbgClient.log(        BasicLevel.DEBUG,        "Destination.newInstance(" +        id + ',' + name + ',' + type + ')');    Destination dest;    if (Queue.isQueue(type)) {      if (TemporaryQueue.isTemporaryQueue(type)) {        dest = new TemporaryQueue(id, null);      } else if (DeadMQueue.isDeadMQueue(type)) {        dest = new DeadMQueue(id);      } else {        dest = new Queue(id);      }    } else if (Topic.isTopic(type)) {      if (TemporaryTopic.isTemporaryTopic(type)) {        dest = new TemporaryTopic(id, null);      } else {        dest = new Topic(id);      }    } else throw new AdminException("Unknown destination type");    dest.adminName = name;    return dest;  }  public static boolean isAssignableTo(String realType,                                       String resultingType) {    return realType.startsWith(resultingType);  }  public Hashtable getStatistic()    throws ConnectException, AdminException {    Monitor_GetStat request =      new Monitor_GetStat(agentId);    Monitor_GetStatRep reply =      (Monitor_GetStatRep) AdminModule.doRequest(request);    return  reply.getStats();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -