예제 #1
1
  public void unregisterKeyStroke(KeyStroke ks, JComponent c) {

    // component may have already been removed from the hierarchy, we
    // need to look up the container using the componentKeyStrokeMap.

    ComponentKeyStrokePair ckp = new ComponentKeyStrokePair(c, ks);

    Container topContainer = componentKeyStrokeMap.get(ckp);

    if (topContainer == null) { // never heard of this pairing, so bail
      return;
    }

    Hashtable keyMap = containerMap.get(topContainer);
    if (keyMap == null) { // this should never happen, but I'm being safe
      Thread.dumpStack();
      return;
    }

    Object tmp = keyMap.get(ks);
    if (tmp == null) { // this should never happen, but I'm being safe
      Thread.dumpStack();
      return;
    }

    if (tmp instanceof JComponent && tmp == c) {
      keyMap.remove(ks); // remove the KeyStroke from the Map
      // System.out.println("removed a stroke" + ks);
    } else if (tmp
        instanceof Vector) { // this means there is more than one component reg for this key
      Vector v = (Vector) tmp;
      v.removeElement(c);
      if (v.isEmpty()) {
        keyMap.remove(ks); // remove the KeyStroke from the Map
        // System.out.println("removed a ks vector");
      }
    }

    if (keyMap.isEmpty()) { // if no more bindings in this table
      containerMap.remove(topContainer); // remove table to enable GC
      // System.out.println("removed a container");
    }

    componentKeyStrokeMap.remove(ckp);

    // Check for EmbeddedFrame case, they know how to process accelerators even
    // when focus is not in Java
    if (topContainer instanceof EmbeddedFrame) {
      ((EmbeddedFrame) topContainer).unregisterAccelerator(ks);
    }
  }
  /**
   * Method addEntry, adds information to the SASLSession table to track what sessions have been
   * authenicated with what critera.
   */
  protected synchronized void addEntry(Session session) throws SASLException {
    boolean anonymous = false;

    if (session == null) throw new SASLException(ERR_INVALID_PARAMETERS);

    SessionCredential cred = session.getPeerCredential();
    if (cred == null) throw new SASLException(ERR_INVALID_PARAMETERS);

    anonymous = cred.getAuthenticatorType().equals(SASLAnonymousProfile.MECHANISM);

    // If this session is mapped to another user, get rid of it.
    String authenticator = (String) sessionToName.get(session);

    // If it's OTP, store it both ways.
    if (anonymous) {
      // This will be in sessionToName by session
      sessionToName.remove(session);
    } else if (authenticator != null) {
      sessionToName.remove(session);
      nameToSession.remove(authenticator);
    }

    // Get the new credential
    authenticator = session.getPeerCredential().getAuthenticator();
    if (authenticator == null) throw new SASLException(ERR_INVALID_PARAMETERS);
    session.addSessionListener(this);
    if (sessionToName.contains(session)) nameToSession.remove(authenticator);
    sessionToName.put(session, authenticator);
    if (!anonymous) nameToSession.put(authenticator, session);
    printContents();
  }
예제 #3
0
  public void executeLast(Hashtable _tagLibrary, Hashtable _beanLibrary) {
    try {
      Boolean included =
          (Boolean)
              (((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Included))
                  .getContent());
      if (included != null && included.booleanValue() == true) {
      } else {
        document =
            (document)
                (((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Document))
                    .getContent());
        java.util.Vector vector =
            ((java.util.Vector)
                (((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Canvas))
                    .getContent()));
        vector.remove(vector.lastElement());
        if (_tagLibrary.get(getName() + ":" + getID()) == null)
          _tagLibrary.remove(getName() + ":" + getID() + "_ids_" + this.motore.hashCode());
        else _tagLibrary.remove(getName() + ":" + getID());

        ((DataOutputStream)
                (((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Writer))
                    .getContent()))
            .writeBytes(document._content + document._comment + document._footer);
      }
    } catch (Exception e) {
      setError(e, iStub.log_ERROR);
    }
  }
  public void waitForLSPaddition(long lspId, long timeWait) {
    Lock lock;
    Condition lspEstablished;
    try {
      lock = lockList.get(lspId);
      if (lock == null) log.info("Lock is NULL!");
      lspEstablished = conditionList.get(lspId);
    } catch (Exception e) {
      return;
    }

    lock.lock();
    try {
      if (established == false) {
        log.info("Waiting " + timeWait + " ms  for LSP " + lspId + " to be established");
        lspEstablished.await(timeWait, TimeUnit.MILLISECONDS);
      } else {
        log.info("Inside waitForLSPaddition lockList.remove");
        // FIXME: Revisar esto
        lockList.remove(lspId);
        conditionList.remove(lspId);
      }
      log.info("LSP " + lspId + " has been established");
    } catch (InterruptedException e) {
      return;
    } finally {
      lock.unlock();
    }
  }
예제 #5
0
  public void heapArrange(int index) {
    int l, r;
    int largest;
    l = 2 * index + 1;
    r = 2 * index + 2;
    if (l <= lastindex && heap[l] > heap[index]) {
      largest = l;
    } else {
      largest = index;
    }
    if (r <= lastindex && heap[r] > heap[largest]) {
      largest = r;
    }
    if (largest != index) {
      int temp = heap[largest];
      hash.remove(heap[index]);
      hash.put(heap[index], largest);
      hash.remove(temp);
      hash.put(temp, index);
      heap[largest] = heap[index];
      heap[index] = temp;

      heapArrange(largest);
    }
  }
  /**
   * 释放指定的sprite
   *
   * @param spriteID
   */
  public static void Put(zSprite spr, boolean freeWhenNoNeed, boolean freeImageWhenNoNeed) {
    short[] state;
    Image[] imgs;
    if ((spr != null) && (spr != zServiceSprite.DUMMY_SPRITE)) {
      state = (short[]) s_SpritesState.get(spr);
      if (state != null) {
        if (state[IDX_REF] > 0) state[IDX_REF]--;

        /** 注意应该在没有人在用的情况下,才归还图像 */
        if (state[IDX_REF] <= 0) {
          imgs = spr.GetImages();
          if (imgs != null) {
            Image img;
            for (int i = imgs.length - 1; i >= 0; i--) {
              img = imgs[i];
              if (img != null) {
                zServiceImage.Put(img, freeImageWhenNoNeed);
              }
            }
          }
          spr.SetImages(null);
        }

        if (freeWhenNoNeed && state[IDX_REF] <= 0) {
          s_SpritesState.remove(spr);
          s_Sprites.remove(spr.Filename);
        }
      }
      ;
    }
    ;
  }
예제 #7
0
  public void insert(int element) {
    int parentindex, tempIndex;
    int temp;
    lastindex += 1;
    heap[lastindex] = element;

    hash.put(element, lastindex);

    tempIndex = lastindex;

    while (tempIndex != 0) {
      parentindex = (tempIndex - 1) / 2;
      if (heap[tempIndex] > heap[parentindex]) {
        temp = heap[parentindex];
        hash.remove(heap[tempIndex]);
        hash.put(heap[tempIndex], parentindex);
        hash.remove(temp);
        hash.put(temp, tempIndex);
        heap[parentindex] = heap[tempIndex];
        heap[tempIndex] = temp;
        tempIndex = parentindex;
      } else {
        tempIndex = 0;
      }
    }
  }
예제 #8
0
  public void executeLast(Hashtable _tagLibrary, Hashtable _beanLibrary) {
    try {
      bean _sysPdfCR = (bean) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_CurrentROW);

      int Y = -1;
      try {
        Y = ((Integer) _sysPdfCR.getContent()).intValue();
      } catch (Exception e) {
      }
      int freez =
          ((WritableSheet)
                  ((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Document))
                      .getContent())
              .getSettings()
              .getVerticalFreeze();
      if (freez == 0)
        ((WritableSheet)
                ((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Document))
                    .getContent())
            .getSettings()
            .setVerticalFreeze(Y);
    } catch (Exception e) {
      setError(e, iStub.log_WARN);
    }

    try {
      if (_tagLibrary.get(getName() + ":" + getID()) == null)
        _tagLibrary.remove(getName() + ":" + getID() + "_ids_" + this.motore.hashCode());
      else _tagLibrary.remove(getName() + ":" + getID());

    } catch (Exception e) {
      setError(e, iStub.log_WARN);
    }
  }
예제 #9
0
  @SuppressWarnings("all")
  // CHECKSTYLE:OFF
  private static Object changeContextWritable(ServletContext servletContext, Object lock)
      throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, NamingException {
    // cette méthode ne peut pas être utilisée avec un simple JdbcDriver
    assert servletContext != null;
    final String serverInfo = servletContext.getServerInfo();
    if ((serverInfo.contains("Tomcat")
            || serverInfo.contains("vFabric")
            || serverInfo.contains("SpringSource tc Runtime"))
        && System.getProperty("jonas.name") == null) {
      // on n'exécute cela que si c'est tomcat
      // et si ce n'est pas tomcat dans jonas
      final Field field =
          Class.forName("org.apache.naming.ContextAccessController")
              .getDeclaredField("readOnlyContexts");
      setFieldAccessible(field);
      @SuppressWarnings("unchecked")
      final Hashtable<String, Object> readOnlyContexts =
          (Hashtable<String, Object>) field.get(null);
      // la clé dans cette Hashtable est normalement
      // "/Catalina/" + hostName + Parameters.getContextPath(servletContext) ;
      // hostName vaut en général "localhost" (ou autre selon le Host dans server.xml)
      // et contextPath vaut "/myapp" par exemple ;
      // la valeur est un securityToken
      if (lock == null) {
        // on utilise clear et non remove au cas où le host ne soit pas localhost dans server.xml
        // (cf issue 105)
        final Hashtable<String, Object> clone = new Hashtable<String, Object>(readOnlyContexts);
        readOnlyContexts.clear();
        return clone;
      }
      // on remet le contexte not writable comme avant
      @SuppressWarnings("unchecked")
      final Hashtable<String, Object> myLock = (Hashtable<String, Object>) lock;
      readOnlyContexts.putAll(myLock);

      return null;
    } else if (serverInfo.contains("jetty")) {
      // on n'exécute cela que si c'est jetty
      final Context jdbcContext = (Context) new InitialContext().lookup("java:comp");
      final Field field = getAccessibleField(jdbcContext, "_env");
      @SuppressWarnings("unchecked")
      final Hashtable<Object, Object> env = (Hashtable<Object, Object>) field.get(jdbcContext);
      if (lock == null) {
        // on rend le contexte writable
        Object result = env.remove("org.mortbay.jndi.lock");
        if (result == null) {
          result = env.remove("org.eclipse.jndi.lock");
        }
        return result;
      }
      // on remet le contexte not writable comme avant
      env.put("org.mortbay.jndi.lock", lock);
      env.put("org.eclipse.jndi.lock", lock);

      return null;
    }
    return null;
  }
예제 #10
0
 protected void delete(String account) {
   accountlist.remove(account);
   accountbalance.remove(account);
   accountcurrency.remove(account);
   accountstatus.remove(account);
   hashaccount.remove(account.toLowerCase());
   treeaccount.remove(account.toLowerCase());
 }
예제 #11
0
  public void logout(String sessionId) {
    Integer userId = sessionToUsers.get(sessionId);
    sessionToUsers.remove(sessionId);

    if (userId != null) {
      currentUsers.remove(userId);
    }
  }
  /*
   * (non-Javadoc)
   *
   * @see java.util.Dictionary#remove(java.lang.Object)
   */
  public Object remove(Object key) {
    if (key == null) {
      throw new NullPointerException("key");
    }

    String lowerCase = String.valueOf(key).toLowerCase();
    originalKeys.remove(lowerCase);
    return internalMap.remove(lowerCase);
  }
 /**
  * Removes a parameter from the design
  *
  * @param param the parameter to be removed.
  * @throws IllegalArgumentException if the parameter is unknown to the design.
  */
 public void removeParameter(Parameter param) {
   if (stringParameterValues.containsKey(param)) {
     stringParameterValues.remove(param);
   } else if (numericalParameterValues.containsKey(param)) {
     numericalParameterValues.remove(param);
   } else {
     throw new IllegalArgumentException("Unknown parameter " + param.getName());
   }
 }
예제 #14
0
  public void executeLast(Hashtable _tagLibrary, Hashtable _beanLibrary) {
    try {
      if (_tagLibrary.get(getName() + ":" + getID()) == null)
        _tagLibrary.remove(getName() + ":" + getID() + "_ids_" + this.motore.hashCode());
      else _tagLibrary.remove(getName() + ":" + getID());

    } catch (Exception e) {
      setError(e, iStub.log_WARN);
    }
  }
예제 #15
0
 /** * Remove a file when the user sends a delete request. */
 @Override
 public void removeItem(HttpServletRequest request, String fieldName)
     throws UploadActionException {
   File file = receivedFiles.get(fieldName);
   receivedFiles.remove(fieldName);
   receivedContentTypes.remove(fieldName);
   if (file != null) {
     file.delete();
   }
 }
예제 #16
0
 /** Removes a SocketAddress mapping */
 public void removeBinding(SocketAddress refer_soaddr) {
   if (refer_soaddr != null) {
     String key = refer_soaddr.toString();
     if (binding_table.containsKey(key)) {
       printLog("remove BINDING for " + refer_soaddr, Log.LEVEL_HIGH);
       binding_table.remove(key);
       time_table.remove(key);
     }
   }
 }
예제 #17
0
파일: War.java 프로젝트: adegie/Towny
 public void remove(WorldCoord worldCoord) {
   try {
     Town town = worldCoord.getTownBlock().getTown();
     TownyMessaging.sendGlobalMessage(
         TownySettings.getWarTimeLoseTownBlockMsg(worldCoord, town.getName()));
     warZone.remove(worldCoord);
   } catch (NotRegisteredException e) {
     TownyMessaging.sendGlobalMessage(TownySettings.getWarTimeLoseTownBlockMsg(worldCoord));
     warZone.remove(worldCoord);
   }
 }
예제 #18
0
  /* (non-Javadoc)
   * @see madkit.netcomm.MadkitNetworkAgent#handleNetworkMessage(madkit.netcomm.NetworkMessage)
   */
  protected void handleNetworkMessage(NetworkMessage message) {
    switch (message.getType()) {
      case NetworkMessage.SYNCH_REQUEST:
        debug("handling NetworkMessage.SYNCH_REQUEST");
        Vector vec = (Vector) message.getArgument();
        handleSynchRequest(message.getSender(), vec);
        break;
      case NetworkMessage.ROUTE_MESSAGE:
        debug("Routing message");
        sendDistantMessage((KernelMessage) message.getArgument());
        break;

      case NetworkMessage.CONNECT_KERNEL:
        debug("CONNECT_KERNEL received");
        Vector v1 = (Vector) message.getArgument();
        Socket brSocket = (Socket) v1.get(0);
        KernelAddress id = (KernelAddress) v1.get(1); // check if the kernel is known
        SocketKernel distantSK = (SocketKernel) v1.get(2);

        if (id != null && routeTable.containsKey(id)) {
          debug("broadcast from known kernel");
          try {
            brSocket.close();
          } catch (IOException e) {
            debug(e.toString());
          }
          break;
        }
        launchNetConfigConnection(distantSK, brSocket, id);
        break;
      case NetworkMessage.KERNEL_DISCONNECTED:
        routeTable.remove(((KernelAddress) message.getArgument()).getID());
        break;
      case NetworkMessage.UPDATE_ROUTE:
        debug("UPDATE_ROUTE");
        Vector v = (Vector) message.getArgument();
        KernelAddress addr = (KernelAddress) v.get(0);
        AgentAddress p2p = (AgentAddress) v.get(1);
        DistantKernelInformation info = (DistantKernelInformation) routeTable.remove(addr.getID());
        info.setP2PAgent(p2p);
        info.setProtocol((String) v.get(2));
        routeTable.put(addr.getID(), info);
        sendMessage(
            getAgentWithRole(community, group, "netagent"),
            new NetworkMessage(NetworkMessage.UPDATE_ROUTE, v));
        sendMessage(
            message.getSender(), new NetworkMessage(NetworkMessage.UPDATE_ROUTE_DONE, addr));
        break;
      default:
        debug("unknown NetworkMessage Received");
        debug(message.toString());
        break;
    }
  }
예제 #19
0
 @Override
 public void windowClosed(WindowEvent event) {
   ResourceEditor editor = (ResourceEditor) event.getSource();
   if (openEditors2.containsKey(editor)) openEditors.remove(openEditors2.get(editor));
   openEditors2.remove(editor);
   mostRecentFocusedEditors.remove(editor);
   editor.removeWindowListener(
       openEditorsListener); // not neceesary since they dispose on close?
   System.gc(); // might help? especially with media resources?
   Application.this.notifyApplicationWindowClosed(event);
 }
  /**
   * Method removeEntry removes SASL/Authenticator data from the SASLSession table. Called when
   * sessions terminate, or when credentials are 'cleared'.
   */
  protected synchronized void removeEntry(Session session) throws SASLException {
    if (session == null) throw new SASLException(ERR_INVALID_PARAMETERS);

    if (session.getPeerCredential() != null) {
      String authenticator = session.getPeerCredential().getAuthenticator();
      if (authenticator == null) throw new SASLException(ERR_INVALID_PARAMETERS);
      nameToSession.remove(authenticator);
    }
    sessionToName.remove(session);
    session.removeSessionListener(this);
    printContents();
  }
예제 #21
0
    /**
     * Here we manage the registered peers: - set crt as first in loaded_peers it may have been part
     * of the list before but we assume that its message was accounted in current_space
     *
     * @param crt
     */
    private static void register_loaded(D_DirectoryEntry crt) {
      ArrayList<D_DirectoryEntry> rem = new ArrayList<D_DirectoryEntry>();
      // crt.encoder = crt.getEncoder();
      // if(crt.loaded_globals) crt.component_node.message = crt.encode(); //crt.encoder.getBytes();
      synchronized (loaded_peers) {
        if (DEBUG) System.out.println("DSCache:register_loaded registering " + crt);
        if (crt.get_DDP2P_DoubleLinkedList_Node() == null) {
          boolean result = loaded_peers.offerFirst(crt);
          if (DEBUG) System.out.println("DSCache:register_loaded registered " + result);
          if (DEBUG) System.out.println("DSCache:register_loaded " + loaded_peers);
          // loaded_peer_By_LocalID.put(new Long(crt._peer_ID), crt);
          loaded_peer_By_GID.put(crt.globalID, crt);
          loaded_peer_By_GIDhash.put(crt.globalIDhash, crt);
          if (crt.component_node.message != null) {
            current_space += crt.component_node.message.length;
          }
        } else {
          loaded_peers.moveToFront(crt);
        }

        while ((loaded_peers.size() > MAX_LOADED_PEERS) || (current_space > MAX_PEERS_RAM)) {
          if (loaded_peers.size() <= MIN_PEERS_RAM) break; // at least _crt_peer and _myself
          //					D_DirectoryEntry candidate = loaded_peers.getTail();
          //					if((candidate == D_DirectoryEntry._crt_peer)||(candidate ==
          // D_DirectoryEntry._myself)){
          //						setRecent(candidate);
          //						continue;
          //					}

          D_DirectoryEntry removed = loaded_peers.removeTail(); // remove(loaded_peers.size()-1);
          // loaded_peer_By_LocalID.remove(new Long(removed._peer_ID));
          loaded_peer_By_GID.remove(removed.globalID);
          loaded_peer_By_GIDhash.remove(removed.globalIDhash);
          if (removed.component_node.message != null)
            current_space -= removed.component_node.message.length;
          if (D_Directory_Storage.need_saving_contains(removed.globalIDhash, removed.instance))
            rem.add(removed);
        }
      }
      if (DEBUG) System.out.println("DSCache:register_loaded cleaned " + loaded_peers);
      for (D_DirectoryEntry removed : rem) {
        try {
          synchronized (D_Directory_Storage.saver_thread_monitor) {
            if (D_Directory_Storage.need_saving_contains(removed.globalIDhash, removed.instance))
              removed.update();
          }
        } catch (P2PDDSQLException e) {
          e.printStackTrace();
        }
      }
      if (DEBUG) System.out.println("DSCache:register_loaded exit " + loaded_peers);
    }
예제 #22
0
public void DelTemplate (String name)
        throws NoSuchElementException
    {
	menus.remove (name);
	Enumeration keys = menumap.keys ();
	Enumeration elms = menumap.elements ();
	while (keys.hasMoreElements() && elms.hasMoreElements()) {
	    String key = (String)keys.nextElement();
	    String elm = (String)elms.nextElement();
	    if (elm.equals (name))
		menumap.remove (key);
	}
    }
예제 #23
0
  public int deletemax() {
    int value = 0;
    int tempindex;
    int temp;
    if (lastindex != -1) {

      value = heap[0];
      hash.remove(value);
      hash.put(value, -inf);
      tempindex = 0;
      heap[0] = heap[lastindex];
      hash.remove(heap[lastindex]);
      if (lastindex != 0) {
        hash.put(heap[lastindex], 0);
      } else {
        hash.put(heap[lastindex], -inf);
      }

      lastindex -= 1;

      while (2 * tempindex + 1 <= lastindex) {
        int largest;
        int l = 2 * tempindex + 1;
        int r = 2 * tempindex + 2;
        if ((heap[l] > heap[tempindex])) {
          largest = l;
        } else {
          largest = tempindex;
        }
        if (r <= lastindex && (heap[r] > heap[largest])) {
          largest = r;
        }

        if (largest != tempindex) {
          temp = heap[largest];
          hash.remove(heap[tempindex]);
          hash.put(heap[tempindex], largest);
          hash.remove(temp);
          hash.put(temp, tempindex);
          heap[largest] = heap[tempindex];
          heap[tempindex] = temp;
        }
        if (largest == l) {
          tempindex = 2 * tempindex + 1;
        } else {
          tempindex = 2 * tempindex + 2;
        }
      }
    }
    return value;
  }
예제 #24
0
  /**
   * Remove a port mapping from the active list
   *
   * @param portMap PortMapping
   * @return boolean
   */
  private final boolean removePortMapping(PortMapping portMap) {

    //	Remove the port mapping from the active lists

    Integer key = new Integer(portMap.hashCode());
    Object removedObj = m_mappings.remove(key);

    key =
        new Integer(PortMapping.generateHashCode(portMap.getProgramId(), 0, portMap.getProtocol()));
    m_noVerMappings.remove(key);

    //	Return a status indicating if the mapping was removed

    return removedObj != null ? true : false;
  }
예제 #25
0
 /** Remove the transaction from transaction hash. */
 protected void removeTransactionHash(SIPTransaction sipTransaction) {
   SIPRequest sipRequest = sipTransaction.getOriginalRequest();
   if (sipRequest == null) return;
   if (sipTransaction instanceof SIPClientTransaction) {
     synchronized (clientTransactionTable) {
       String key = sipTransaction.getTransactionId();
       clientTransactionTable.remove(key);
     }
   } else if (sipTransaction instanceof SIPServerTransaction) {
     synchronized (serverTransactionTable) {
       String key = sipTransaction.getTransactionId();
       serverTransactionTable.remove(key);
     }
   }
 }
예제 #26
0
  public void executeLast(Hashtable _tagLibrary, Hashtable _beanLibrary) {
    try {
      bean _sysPdfCC = (bean) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_CurrentCELL);
      bean _sysPdfCR = (bean) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_CurrentROW);

      int X = 0;
      try {
        X = ((Integer) _sysPdfCC.getContent()).intValue();
      } catch (Exception e) {
      }

      int Y = 0;
      try {
        Y = ((Integer) _sysPdfCR.getContent()).intValue();
      } catch (Exception e) {
      }

      WritableSheet document =
          (WritableSheet)
              (((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Document))
                  .getContent());

      ((java.util.Vector)
              (((report_element_base) _beanLibrary.get("SYSTEM:" + iConst.iHORT_SYSTEM_Canvas))
                  .getContent()))
          .add(this.getCellC(document.getWritableCell(X, Y), X, Y));

      try {
        if (!internal_style.getWIDTH().equals(""))
          document.setColumnView(X, new Integer(internal_style.getWIDTH()).intValue());
      } catch (Exception e) {
      }
      if (!internal_style.getHEIGHT().equals("") && parent != null && parent instanceof table_row)
        ((table_row) parent).setHEIGHT(internal_style.getHEIGHT());

      X++;

      _sysPdfCC.setContent(new Integer(X));
      _beanLibrary.put(_sysPdfCC.getName() + ":" + _sysPdfCC.getID(), _sysPdfCC);

      if (_tagLibrary.get(getName() + ":" + getID()) == null)
        _tagLibrary.remove(getName() + ":" + getID() + "_ids_" + this.motore.hashCode());
      else _tagLibrary.remove(getName() + ":" + getID());

    } catch (Exception e) {
      setError(e, iStub.log_WARN);
    }
  }
예제 #27
0
        public void handle(SubscribeRequest msg) {
          // messages++;
          //			System.out.println("  Server received subscription " + msg.getTopic());

          if (subcriptionRepository.containsKey(msg.getTopic())) {
            Vector<Address> subscriberlist =
                (Vector<Address>) subcriptionRepository.get(msg.getTopic());

            // to avoid duplicate subscriber
            if (!subscriberlist.contains(msg.getSource())) {
              subscriberlist.add(msg.getSource()); // Will this mutate the
              // instant in the object
              // inside?

              subcriptionRepository.remove(msg.getTopic());
              subcriptionRepository.put(msg.getTopic(), subscriberlist);
            }

            //				System.out.println("  Subscriber list for topic id "
            //						+ msg.getTopic() + " : " + subscriberlist.toString());

          } else {
            Vector<Address> subscriberlist = new Vector<Address>();
            subscriberlist.add(msg.getSource());
            //				System.out.println("  Address source: " + msg.getSource());
            subcriptionRepository.put(msg.getTopic(), subscriberlist);

            System.out.println(
                "  Subscriber list for topic id (new topic)"
                    + msg.getTopic()
                    + " : "
                    + subscriberlist.toString());
          }
        }
예제 #28
0
  /**
   * To retrieve the current image index that is currently animating and then updating the current
   * to the next image
   *
   * @param id
   */
  public void changeCurrIndex(Integer id) {
    // gives the animation name give the entity id
    String animation = mCurrentAnimation.get(id);
    // gets  the actual array assoc with the name
    CircularArray<Texture2> arr = mReelsNameAssoc.get(animation);

    // checks if the key is in the hash table
    if (mUpdateCurrAni.containsKey(id)) {
      int imgIndex = mUpdateCurrAni.get(id); // Retrieve the last draw's image index

      mUpdateCurrAni.remove(id); // remove it

      if (imgIndex < arr.size() - 1) { // check if the current index is still within bound

        imgIndex++; // increment the index

        mUpdateCurrAni.put(id, imgIndex); //  put next index in
      } else {

        imgIndex = 0; // when we are at the last index wrap back to the beginning
      }

    } else {
      // else is it not in the table we add with the index being 0
      mUpdateCurrAni.put(id, 0);
    }
  }
 /** Method to eliminate all LSPs. It is meant to be used in case of ROADM safe shut down. */
 public void killAllLSP() {
   log.info("Killing All LSPs");
   Enumeration<LSPKey> e = LSPList.keys();
   while (e.hasMoreElements()) {
     LSPList.remove(e.nextElement());
   }
 }
예제 #30
0
파일: Channel.java 프로젝트: kkkon/remoting
 /**
  * Sets the property value on this side of the channel.
  *
  * @see #getProperty(Object)
  */
 public Object setProperty(Object key, Object value) {
   synchronized (properties) {
     Object old = value != null ? properties.put(key, value) : properties.remove(key);
     properties.notifyAll();
     return old;
   }
 }