Package java.util

Examples of java.util.Iterator


        if (executorsDir.exists()) {
            if (log.isDebugEnabled()) {
                log.debug("Loading event sources from : " + executorsDir.getPath());
            }

            Iterator executors = FileUtils.iterateFiles(executorsDir, extensions, false);
            while (executors.hasNext()) {
                File file = (File) executors.next();
                OMElement document = getOMElement(file);
                PriorityExecutor executor = SynapseXMLConfigurationFactory.
                        defineExecutor(synapseConfig, document, properties);
                if (executor != null) {
                    executor.setFileName(file.getName());
View Full Code Here


        if (messageStoresDir.exists() ) {
            if (log.isDebugEnabled()) {
                log.debug("Loading Message Stores from :" + messageStoresDir.getPath());
            }

            Iterator messageStores = FileUtils.iterateFiles(messageStoresDir, extensions, false);
            while (messageStores.hasNext()) {
                File file = (File) messageStores.next();
                OMElement document = getOMElement(file);
                MessageStore messageStore = SynapseXMLConfigurationFactory.defineMessageStore(
                        synapseConfig, document, properties);
                if (messageStore != null) {
                    messageStore.setFileName(file.getName());
View Full Code Here

        if (messageProcessorDir.exists()) {
            if (log.isDebugEnabled()) {
                log.debug("Loading Message Processors from :" + messageProcessorDir.getPath());
            }

            Iterator messageProcessors = FileUtils.iterateFiles(messageProcessorDir, extensions, false);
            while (messageProcessors.hasNext()) {
                File file = (File) messageProcessors.next();
                OMElement document = getOMElement(file);
                MessageProcessor messageProcessor = SynapseXMLConfigurationFactory.defineMessageProcessor(
                        synapseConfig, document, properties);
                if (messageProcessor != null) {
                    messageProcessor.setFileName(file.getName());
View Full Code Here

    private void registerExtensions() {
        if (log.isDebugEnabled()) {
            log.debug("Registering mediator extensions found in the classpath.. ");
        }
        // register MediatorSerializer extensions
        Iterator it = Service.providers(MediatorSerializer.class);
        while (it.hasNext()) {
            MediatorSerializer ms = (MediatorSerializer) it.next();
            String name = ms.getMediatorClassName();
            try {
                serializerMap.put(name, ms.getClass().newInstance());
            } catch (InstantiationException e) {
                handleException("Error instantiating mediator serializer : " + ms);
View Full Code Here

  public void testValidate() throws ConversionException
  {

    Map validators = createStrictMock(Map.class);
    Set keys = createStrictMock(Set.class);
    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    Date sqlDate = Date.valueOf("1999-12-12");
    simpleForm.setDateValue("1999-12-12");
    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
    expect(validators.get(op)).andReturn(methodValidators);
    expect(methodValidators.getRequiresConversion()).andReturn(true);
    expect(methodValidators.getConverter()).andReturn(converter);
    expect(op.getPropertyName()).andReturn("dateValue");
    expect(converter.toTargetType("1999-12-12")).andReturn(sqlDate);
    expect(methodValidators.getConverterType()).andReturn(sqlDate.getClass());
    expect(iterator.hasNext()).andReturn(false);

    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("dateValue", sqlDate);

    // expect validationStrategy to be called
View Full Code Here

  public void testBadType() throws ConversionException
  {

    Map validators = createStrictMock(Map.class);
    Set keys = createStrictMock(Set.class);
    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    Date sqlDate = Date.valueOf("1999-12-12");
    simpleForm.setDateValue("1999-12-12");
    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
    expect(validators.get(op)).andReturn(methodValidators);
    expect(methodValidators.getRequiresConversion()).andReturn(true);
    expect(methodValidators.getConverter()).andReturn(converter);
    expect(op.getPropertyName()).andReturn("dateValue");
    expect(converter.toTargetType("1999-12-12")).andReturn(sqlDate);
View Full Code Here

  public void testValidateNull() throws ConversionException
  {

    Map validators = createStrictMock(Map.class);
    Set keys = createStrictMock(Set.class);
    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
    expect(validators.get(op)).andReturn(methodValidators);
    expect(methodValidators.getRequiresConversion()).andReturn(true);
    expect(methodValidators.getConverter()).andReturn(converter);
    expect(op.getPropertyName()).andReturn("dateValue");
    expect(converter.toTargetType(null)).andReturn(null);
    expect(iterator.hasNext()).andReturn(false);

    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("dateValue", ConversionState.NULL);

    // expect validationStrategy to be called
View Full Code Here

  public void testConversionFailure() throws ConversionException
  {

    Map validators = createStrictMock(Map.class);
    Set keys = createStrictMock(Set.class);
    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
    expect(validators.get(op)).andReturn(methodValidators);
    expect(methodValidators.getRequiresConversion()).andReturn(true);
    expect(methodValidators.getConverter()).andReturn(converter);
    expect(op.getPropertyName()).andReturn("dateValue");
    expect(converter.toTargetType(null)).andThrow(new ConversionRuntimeException(null));
    expect(iterator.hasNext()).andReturn(false);

    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("dateValue", ConversionState.FAILURE);

    // expect validationStrategy to be called
View Full Code Here

        return processor;
    }

    private static Map<String, Object> getParameters(OMElement elem) {
        Iterator params = elem.getChildrenWithName(PARAMETER_Q);
        Map<String, Object> parameters = new HashMap<String, Object>();

        while (params.hasNext()) {
            Object o = params.next();
            if (o instanceof OMElement) {
                OMElement prop = (OMElement) o;
                OMAttribute paramName = prop.getAttribute(NAME_Q);
                String paramValue = prop.getText();
                if (paramName != null) {
View Full Code Here

   */
  public List forums(HttpServletRequest req, SiteBean site, SessionUserObject user){
    List forums = (List)req.getAttribute(FORUMS);
    if(forums == null && site!=null){
      forums = site.getForums();
      Iterator iter = forums.iterator();
      while(iter.hasNext()){
        ForumBean fbean = (ForumBean)iter.next();
        if (fbean.getStatus() == ForumBean.STATUS_HIDDEN
            && (user == null || !site.isOwner(user)))
          iter.remove();
      }
      req.setAttribute(FORUMS, forums);
    }
    return forums;
  }
View Full Code Here

TOP

Related Classes of java.util.Iterator

Copyright © 2015 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.