Package org.wymiwyg.rwcf

Examples of org.wymiwyg.rwcf.Handler


      throw new RuntimeException(ex);
    }
    try {
      //Class clazz = Thread.currentThread().getContextClassLoader().loadClass(javaClass);
      Class clazz = Class.forName(javaClass);
      Handler unitializedHandler;
      try {
        unitializedHandler = (Handler) clazz.newInstance();
      } catch (ClassCastException ex) {
        throw new RuntimeException("The class " + javaClass
            + " is not an instance of " + Handler.class.getName());
      }
      unitializedHandler.init(new HandlerConfigImp(handlerResource,
          handlerContext));
      handler = unitializedHandler;
    } catch (ClassNotFoundException e) {
      throw new RuntimeException("Handler with class " + javaClass
          + " could not be loaded (using Class.forName())", e);
View Full Code Here


        AuthorizationInfo authorizationInfo = new AuthorizationInfo();
        HandlerChainImpl typeBasedChain = getBestHandlerChain(request,
                authorizationInfo, false);
        if (typeBasedChain != null) {
            //add terminator-handler
            typeBasedChain.addHandler(new Handler() {
                public void handle(Request request, Response response,
                        HandlerChain innerChain) throws HandlerException {
                    ((HandlerChainImpl) handlerChain).readLocked = ((HandlerChainImpl) innerChain).readLocked;
                    ((HandlerChainImpl) handlerChain).writeLocked = ((HandlerChainImpl) innerChain).writeLocked;
                    handlerChain.doNext(request, response);
View Full Code Here

    if (pos < handlerList.size()) {
      boolean writeLockedHere = false;
      boolean unWriteLockedHere = false;
      boolean readLockedHere = false;
      boolean unReadLockedHere = false;
      Handler current = (Handler) handlerList.get(pos++);
      if (current.requiresWriteLock()) {
        if (!writeLocked) {
          if (readLocked) {
            model.leaveCriticalSection();
            readLocked = false;
            unReadLockedHere = true;
          }
          model.enterCriticalSection(ModelLock.WRITE);
          writeLockedHere = true;
          writeLocked = true;
        }
      } else {
        if (writeLocked) {
          model.leaveCriticalSection();
          writeLocked = false;
          unWriteLockedHere = true;
        }
        if (current.requiresReadLock()) {
          if (!readLocked) {
            model.enterCriticalSection(ModelLock.READ);
            readLocked = true;
            readLockedHere = true;
          }
        } else {
          if (readLocked) {
            model.leaveCriticalSection();
            readLocked = false;
            unReadLockedHere = true;
          }
        }
      }
      try {
        if (log.isDebugEnabled()) {
          log.debug("performing " + current);
        }
        current.handle(request, response, this);
      } finally {
        if (writeLockedHere) {
          model.leaveCriticalSection();
          writeLocked = false;
        }
View Full Code Here

TOP

Related Classes of org.wymiwyg.rwcf.Handler

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.