Exemplo n.º 1
0
  /**
   * INTERNAL: Register the session under its name. All of the session's descriptors must have
   * already been registered. The session should not be connected and descriptors should not be
   * initialized. Used for client session broker
   */
  public void internalRegisterSession(String name, AbstractSession session) {
    // Bug#3911318  Removed session brokers and sessions point to the same descriptors.
    // They don't need to be reassigned.  Also the code to add read only classes has been removed
    // because client broker and server broker point to the same project.
    session.setIsInBroker(true);
    getSessionsByName().put(name, session);
    session.setBroker(this);
    session.setName(name);

    /*       // The keys/classes must also be used as some descriptors may be under multiple classes.
          Iterator classes = session.getDescriptors().keySet().iterator();
          while (classes.hasNext()) {
              Class descriptorClass = (Class)classes.next();
              getSessionNamesByClass().put(descriptorClass, session);
          }
    */ }
Exemplo n.º 2
0
  /**
   * PUBLIC: Register the session under its name. All of the session's descriptors must have already
   * been registered. The session should not be connected and descriptors should not be initialized.
   */
  public void registerSession(String name, AbstractSession session) {
    session.setIsInBroker(true);
    getSessionsByName().put(name, session);
    session.setBroker(this);
    session.setName(name);

    // The keys/classes must also be used as some descriptors may be under multiple classes.
    Iterator descriptors = session.getDescriptors().values().iterator();
    Iterator classes = session.getDescriptors().keySet().iterator();
    while (descriptors.hasNext()) {
      ClassDescriptor descriptor = (ClassDescriptor) descriptors.next();
      Class descriptorClass = (Class) classes.next();
      getSessionNamesByClass().put(descriptorClass, name);
      getDescriptors().put(descriptorClass, descriptor);
    }
  }