Package org.megatome.frame2.jaxbgen

Examples of org.megatome.frame2.jaxbgen.ObjectFactory


    Map<String, Forward> forwards = reader.getGlobalHTMLForwards();
    assertTrue(forwards.size() == 3);

    Forward forward = forwards.get("xx1"); //$NON-NLS-1$
    ForwardProxy proxy = new ForwardProxy(forward);
    assertFalse(proxy.isEventType());
    assertEquals(forward.getName(), "xx1"); //$NON-NLS-1$
    assertEquals(forward.getType(), ForwardType.HTMLRESOURCE);
    assertEquals(forward.getPath(), "xxxpath1"); //$NON-NLS-1$

    forward = forwards.get("xx2"); //$NON-NLS-1$
    proxy = new ForwardProxy(forward);
    assertTrue(proxy.isEventType());
    assertEquals(forward.getName(), "xx2"); //$NON-NLS-1$
    assertEquals(forward.getType(), ForwardType.EVENT);
    assertEquals(forward.getPath(), "xxxpath2"); //$NON-NLS-1$

    forward = forwards.get("xx3"); //$NON-NLS-1$
    proxy = new ForwardProxy(forward);
    assertFalse(proxy.isEventType());
    assertEquals(forward.getName(), "xx3"); //$NON-NLS-1$
    assertEquals(forward.getType(), ForwardType.HTMLRESOURCE);
    assertEquals(forward.getPath(), "xxxpath3"); //$NON-NLS-1$

  }
View Full Code Here


        this.request = new Frame2HttpServletRequestSimulator(this.config
                .getServletContext());
        this.response = new HttpServletResponseSimulator();
        this.context = (MockFrame2ServletContextSimulator)this.config
                .getServletContext();
        this.listener = new Frame2ContextListener();
        this.isInitialized = true;

        sendContextInitializedEvent(null, null);

        this.servlet.init(this.config);
View Full Code Here

     * object to use in this test.
     */
    @Before
  public void setUp() throws Exception {
        if (this.servlet == null) {
            this.servlet = new HttpFrontController();
        }
        LoggerFactory.setType("org.megatome.frame2.log.impl.StandardLogger", //$NON-NLS-1$
                getClass().getClassLoader());
        this.config = new MockFrame2ServletConfigSimulator();
        //request = new
View Full Code Here

      DocumentBuilder db = dbf.newDocumentBuilder();

      result = db.newDocument();
    } catch (Exception e) {
      throw new TranslationException("Unable to create target document", //$NON-NLS-1$
          e);
    }

    return result;
  }
View Full Code Here

      DocumentBuilder db = dbf.newDocumentBuilder();

      result = db.newDocument();
    } catch (Exception e) {
      throw new TranslationException("Unable to create target document", //$NON-NLS-1$
          e);
    }

    return result;
  }
View Full Code Here

      DocumentBuilder db = dbf.newDocumentBuilder();

      result = db.newDocument();
    } catch (Exception e) {
      throw new TranslationException("Unable to create target document", //$NON-NLS-1$
          e);
    }

    return result;
  }
View Full Code Here

   *            The path of the configuration file to load from.
   * @throws ConfigException
   *             If loading the configuration fails.
   */
  public Configuration(String path) throws ConfigException {
    this.reader = new EventConfigReader(path);
    this.path = path;
    processConfig();
  }
View Full Code Here

   *            The InputStream of the configuration file.
   * @throws Exception
   *             If loading the configuration fails.
   */
  public Configuration(InputStream is) throws ConfigException {
    this.reader = new EventConfigReader(is);
    processConfig();
  }
View Full Code Here

   * @return DOCUMENT ME!
   * @throws ConfigException
   *             DOCUMENT ME!
   */
  public EventProxy getEventProxy(String eventName) throws ConfigException {
    EventDef eventDef = this.events.get(eventName);
    Event event = null;

    if (eventDef == null) {
      throw new ConfigException("Invalid Event Name: " + eventName); //$NON-NLS-1$
    }

    try {
      String type = eventDef.getType();

      if (type != null) {
        // event = (Event) getClass().forName(type).newInstance();
        event = (Event) Class.forName(type).newInstance();
        event.setEventName(eventName);
View Full Code Here

    try {
      if (handlerNames != null) {
        for (int i = 0; i < handlerNames.size(); i++) {
          String handlerName = handlerNames.get(i);
          EventHandlerDef handlerDef = this.eventHandlers
              .get(handlerName);

          if (handlerDef == null) {
            throw new ConfigException("Handler : " + handlerName //$NON-NLS-1$
                + " is not configured"); //$NON-NLS-1$
          }

          // EventHandler handler = (EventHandler)
          // getClass().forName(handlerDef.getType())
          // .newInstance();
          EventHandler handler = (EventHandler) Class.forName(
              handlerDef.getType()).newInstance();

          result.add(new EventHandlerProxy(handlerName, handler,
              handlerDef));
        }
      }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.jaxbgen.ObjectFactory

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.