Package java.util

Examples of java.util.Set


   * @return
   */
  private Object[] getRoles() {
    ArrayList principalRoles = new ArrayList();
    // Retrieve all roles of the user (Roles are members of the Group.class)
    Set principals = subject.getPrincipals(Group.class);
    Iterator iterator = principals.iterator();
    while (iterator.hasNext()) {
      Group group = (Group) iterator.next();
      // Signed group (empty group that contains a signature)?
      if (group instanceof JSigned) {
        continue;
View Full Code Here


  /**
   * @return
   */
  private  byte[] getSignature() {
    // Retrieve signature (members of the Group.class)
    Set principals = subject.getPrincipals(Group.class);
    Iterator iterator = principals.iterator();
    while (iterator.hasNext()) {
      Group group = (Group) iterator.next();
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "getSignature group = " + group.getClass().getName());
      // Signed group (empty group that contains a signature)?
View Full Code Here

                atLeastOneFits = true;
            }

//          compose cells array list for subsequent code
            cells.clear();
            Set opt = new HashSet();
            iterator = rows.iterator();
            while (iterator.hasNext()) {
                ArrayList row = (ArrayList) iterator.next();
               
                Iterator cellIterator = row.iterator();
                while (cellIterator.hasNext()) {
                    cell = (PdfCell) cellIterator.next();
                   
                    if (!opt.contains(cell)) {
                        cells.add(cell);
                        opt.add(cell);
                    }
                }
            }
           
      // we paint the graphics of the table after looping through all the cells
View Full Code Here

     */
    private synchronized void initialize() throws Exception {

        MBeanServer server = getContainerWrapper().getResourceResolver().getMBeanServer();
        String serverName = getContainerWrapper().getTomcatContainer().getName();
        Set threadPools = server.queryMBeans(new ObjectName(serverName + ":type=ThreadPool,*"), null);
        poolNames = new ArrayList(threadPools.size());
        for (Iterator it = threadPools.iterator(); it.hasNext();) {

            ThreadPoolObjectName threadPoolObjectName = new ThreadPoolObjectName();
            ObjectName threadPoolName = ((ObjectInstance) it.next()).getObjectName();

            String name = threadPoolName.getKeyProperty("name");

            threadPoolObjectName.setThreadPoolName(threadPoolName);
            ObjectName grpName = server.getObjectInstance(
                    new ObjectName(threadPoolName.getDomain() + ":type=GlobalRequestProcessor,name=" + name)).getObjectName();
            threadPoolObjectName.setGlobalRequestProcessorName(grpName);

            //
            // unfortunately exact workers could not be found at the time of testing
            // so we filter out the relevant workers within the loop
            //
            Set workers = server.queryMBeans(new ObjectName(threadPoolName.getDomain() + ":type=RequestProcessor,*"), null);

            for (Iterator wrkIt = workers.iterator(); wrkIt.hasNext();) {
                ObjectName wrkName = ((ObjectInstance) wrkIt.next()).getObjectName();
                if (name.equals(wrkName.getKeyProperty("worker"))) {
                    threadPoolObjectName.getRequestProcessorNames().add(wrkName);
                }
            }

            poolNames.add(threadPoolObjectName);
        }

        Set executors = server.queryMBeans(new ObjectName(serverName + ":type=Executor,*"), null);
        executorNames = new ArrayList(executors.size());
        for (Iterator it = executors.iterator(); it.hasNext();) {
            ObjectName executorName = ((ObjectInstance) it.next()).getObjectName();
            executorNames.add(executorName);
        }

        // Register with MBean server
View Full Code Here

        List resources = new ArrayList();

        MBeanServer server = getMBeanServer();
        if (server != null) {
            try {
                Set dsNames = server.queryNames(new ObjectName("Catalina:type=Resource,resourcetype=Global,*"), null);
                for (Iterator it = dsNames.iterator(); it.hasNext();) {
                    ObjectName objectName = (ObjectName) it.next();
                    ApplicationResource resource = new ApplicationResource();

                    logger.info("reading resource: " + objectName);
                    resource.setName(getStringAttribute(server, objectName, "name"));
View Full Code Here

    public TestCollectorVisitor(String name) {
        super(name);
    }

    public Set getStringSet(Collection objs) {
        Set strings = new HashSet();
       
        Iterator iter = objs.iterator();
        while(iter.hasNext()) {
            Object obj = iter.next();
            if(obj == null) {
                strings.add(null);
            } else {
                strings.add(obj.toString());
            }
        }
       
        return strings;
    }
View Full Code Here

       
        return strings;
    }
   
    public void helpTestCollection(LanguageObject obj, Class type, String[] objects) {
        Set actualObjects = getStringSet(CollectorVisitor.collectObjects(type, obj));
        Set expectedObjects = new HashSet(Arrays.asList(objects));
       
        assertEquals("Did not get expected objects", expectedObjects, actualObjects); //$NON-NLS-1$
    }
View Full Code Here

        helpTestCollection(example1(), Expression.class, new String[] {"g1.e1", "g1.e2", "length(g1.e2)" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }


    public void helpTestElementsUsedByGroups(LanguageObject obj, String[] elements, String[] groups) {
        Set actualElements = getStringSet(CollectorVisitor.collectElements(obj));
        Set actualGroups = getStringSet(CollectorVisitor.collectGroupsUsedByElements(obj));
       
        Set expectedElements = new HashSet(Arrays.asList(elements));
        Set expectedGroups = new HashSet(Arrays.asList(groups));
       
        assertEquals("Did not get expected elements", expectedElements, actualElements); //$NON-NLS-1$
        assertEquals("Did not get expected groups", expectedGroups, actualGroups);         //$NON-NLS-1$
    }
View Full Code Here

      ServiceRegistration registration = (ServiceRegistration) registeredServices.get(objName);
      registration.setProperties(registrationProperties);
      return;
    }
   
    Set serviceNames = new HashSet();
    computeOSGiServiceNames(obj.getClass(), obj, serviceNames);
    ServiceRegistration registration = Activator.context.registerService((String[]) serviceNames.toArray(new String[serviceNames.size()]), obj, registrationProperties);
    registeredServices.put(objName, registration);
  }
View Full Code Here

 
  public Set queryNames(String objectName) throws MalformedObjectNameException {
    if (mxserver == null) {
      return null;
    }
    Set objectNames = mxserver.queryNames(new ObjectName(objectName), null);
    Set names = new HashSet();
    for (Iterator iterator = objectNames.iterator(); iterator.hasNext();) {
      ObjectName objName = (ObjectName) iterator.next();
      names.add(objName.getCanonicalName());
    }
    return names;
  }
View Full Code Here

TOP

Related Classes of java.util.Set

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.