Package java.util.Map

Examples of java.util.Map.Entry


     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#getTests(long)
     */
    public synchronized List/*<Test>*/ getTests(long bundleId) {
        Iterator/*<Entry<Bundle, List<Class>>>*/ it = m_suites.entrySet().iterator();
        while (it.hasNext()) {
            Entry/*<Bundle, List<Class>>*/ entry = (Entry) it.next();
            Bundle bundle = (Bundle) entry.getKey();
            if (bundle.getBundleId() == bundleId) {
                List/*<Test>*/ results = new ArrayList/*<Test>*/();
                List/*<Class>*/ list = (List) m_suites.get(bundle);
                for (int i = 0; i < list.size(); i++) {
                    Test test = createTestFromClass((Class) list.get(i), bundle);
View Full Code Here


     * @see org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner#run(long)
     */
    public synchronized List/*<TestResult>*/ run(long bundleId) {
        Iterator/*<Entry<Bundle, List<Class>>>*/ it = m_suites.entrySet().iterator();
        while (it.hasNext()) {
            Entry/*<Bundle, List<Class>>*/ entry = (Entry) it.next();
            Bundle bundle = (Bundle) entry.getKey();
            if (bundle.getBundleId() == bundleId) {
                List/*<TestResult>*/ results = new ArrayList/*<TestResult>*/();
                List/*<Class>*/ list = (List) m_suites.get(bundle);
                for (int i = 0; i < list.size(); i++) {
                    Test test = createTestFromClass((Class) list.get(i), bundle);
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutput out = new ObjectOutputStream( bos );

        out.writeInt( this.store.size() );
        for (Entry<String, byte[]> stringEntry : this.store.entrySet()) {
            Entry entry = (Entry) stringEntry;
            out.writeObject(entry.getKey());
            out.writeObject(entry.getValue());
        }
        out.flush();
        out.close();
        byte[] buff = bos.toByteArray();
        stream.writeObject( buff );
        if (helper.isSigned()) {
            sign( stream,
                  helper,
                  buff );
        }

        stream.writeInt( this.invokerLookups.size() );
        for (Entry<String, Object> stringObjectEntry : this.invokerLookups.entrySet()) {
            Entry entry = (Entry) stringObjectEntry;
            stream.writeObject(entry.getKey());
            stream.writeObject(entry.getValue());
        }

        stream.writeInt( this.classLookups.size() );
        for (Iterator it = this.classLookups.entrySet().iterator(); it.hasNext();) {
            Entry<String, byte[]> entry = (Entry<String,byte[]>) it.next();
            stream.writeObject( entry.getKey() );
            stream.writeObject( entry.getValue() );
        }

    }
View Full Code Here

        this.rootClassLoader.addClassLoader( this.classLoader );

        // Wire up invokers
        try {
            for (final Object object : getInvokers().entrySet()) {
                Entry entry = (Entry) object;
                wire( (String) entry.getKey(),
                      entry.getValue() );
            }
        } catch (final ClassNotFoundException e) {
            throw new RuntimeDroolsException( e );
        } catch (final InstantiationError e) {
            throw new RuntimeDroolsException( e );
View Full Code Here

                                              "drools.dialect",
                                              false );
        setDefaultDialect( (String) dialectProperties.remove( DefaultDialectOption.PROPERTY_NAME ) );

        for (Object o : dialectProperties.entrySet()) {
            Entry entry = (Entry) o;
            String str = (String) entry.getKey();
            String dialectName = str.substring(str.lastIndexOf(".") + 1);
            String dialectClass = (String) entry.getValue();
            addDialect(dialectName, dialectClass);
        }
    }
View Full Code Here

    if (existingDirectives == null ? newDirectives != null : newDirectives == null)
      return false;
    if (exactMatch && existingDirectives.size() != newDirectives.size())
      return false;
    for (Iterator entries = existingDirectives.entrySet().iterator(); entries.hasNext();) {
      Entry entry = (Entry) entries.next();
      Object newValue = newDirectives.get(entry.getKey());
      if (newValue == null || entry.getValue().getClass() != newValue.getClass())
        return false;
      if (newValue instanceof String[]) {
        if (!Arrays.equals((Object[]) entry.getValue(), (Object[]) newValue))
          return false;
      } else if (!entry.getValue().equals(newValue)) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

  public SignedContentEntry[] getSignedEntries() {
    if (contentMDResults == null)
      return new SignedContentEntry[0];
    ArrayList results = new ArrayList(contentMDResults.size());
    for (Iterator iMDResults = contentMDResults.entrySet().iterator(); iMDResults.hasNext();) {
      Entry entry = (Entry) iMDResults.next();
      String entryName = (String) entry.getKey();
      Object[] mdResult = (Object[]) entry.getValue();
      results.add(new SignedContentEntryImpl(entryName, (SignerInfo[]) mdResult[0]));
    }
    return (SignedContentEntry[]) results.toArray(new SignedContentEntry[results.size()]);
  }
View Full Code Here

    // keyed by entry path -> {SignerInfo[] infos, byte[][] results)}
    HashMap contentMDResults = signedContent.getContentMDResults();
    os.writeInt(contentMDResults == null ? -1 : contentMDResults.size());
    if (contentMDResults != null)
      for (Iterator iResults = contentMDResults.entrySet().iterator(); iResults.hasNext();) {
        Entry entry = (Entry) iResults.next();
        String path = (String) entry.getKey();
        os.writeUTF(path);
        Object[] signerResults = (Object[]) entry.getValue();
        SignerInfo[] entrySigners = (SignerInfo[]) signerResults[0];
        byte[][] entryResults = (byte[][]) signerResults[1];
        os.writeInt(entrySigners.length);
        for (int i = 0; i < entrySigners.length; i++) {
          saveSignerInfo(entrySigners[i], os);
View Full Code Here

      processSigner(wrappedBundleFile, manifestBytes, (String) iSigners.next());

    // done processing now create a SingedContent to return
    SignerInfo[] allSigners = (SignerInfo[]) signerInfos.toArray(new SignerInfo[signerInfos.size()]);
    for (Iterator iResults = contentMDResults.entrySet().iterator(); iResults.hasNext();) {
      Entry entry = (Entry) iResults.next();
      ArrayList[] value = (ArrayList[]) entry.getValue();
      SignerInfo[] entrySigners = (SignerInfo[]) value[0].toArray(new SignerInfo[value[0].size()]);
      byte[][] entryResults = (byte[][]) value[1].toArray(new byte[value[1].size()][]);
      entry.setValue(new Object[] {entrySigners, entryResults});
    }
    SignedContentImpl result = new SignedContentImpl(allSigners, (supportFlags & SignedBundleHook.VERIFY_RUNTIME) != 0 ? contentMDResults : null);
    result.setContent(signedBundle);
    result.setTSASignerInfos(tsaSignerInfos);
    return result;
View Full Code Here

  public void setOptions(Map ops) {
    if (ops == null)
      throw new IllegalArgumentException("The options must not be null."); //$NON-NLS-1$
    Properties newOptions = new Properties();
    for (Iterator entries = ops.entrySet().iterator(); entries.hasNext();) {
      Entry entry = (Entry) entries.next();
      if (!(entry.getKey() instanceof String) || !(entry.getValue() instanceof String))
        throw new IllegalArgumentException("Option keys and values must be of type String: " + entry.getKey() + "=" + entry.getValue()); //$NON-NLS-1$ //$NON-NLS-2$
      newOptions.put(entry.getKey(), ((String) entry.getValue()).trim());
    }
    Set fireChangesTo = null;

    synchronized (lock) {
      if (options == null) {
        disabledOptions = newOptions;
        // no events to fire
        return;
      }
      fireChangesTo = new HashSet();
      // first check for removals
      for (Iterator keys = options.keySet().iterator(); keys.hasNext();) {
        String key = (String) keys.next();
        if (!newOptions.containsKey(key)) {
          String symbolicName = getSymbolicName(key);
          if (symbolicName != null)
            fireChangesTo.add(symbolicName);
        }
      }
      // now check for changes to existing values
      for (Iterator newEntries = newOptions.entrySet().iterator(); newEntries.hasNext();) {
        Entry entry = (Entry) newEntries.next();
        String existingValue = (String) options.get(entry.getKey());
        if (!entry.getValue().equals(existingValue)) {
          String symbolicName = getSymbolicName((String) entry.getKey());
          if (symbolicName != null)
            fireChangesTo.add(symbolicName);
        }
      }
      // finally set the actual options
View Full Code Here

TOP

Related Classes of java.util.Map.Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.