Examples of JNDIRequest


Examples of fr.dyade.aaa.jndi2.msg.JndiRequest

  public JndiReply invoke(RequestContext reqCtx) {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "RequestManager.invoke(" + reqCtx + ')');
    JndiRequest request = reqCtx.getRequest();
    try {     
      if (request instanceof JndiReadRequest) {
        // 1- Dispatch the read requests
        return invokeReadRequest(reqCtx);
      } else if (request instanceof JndiAdminRequest) {
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.JndiRequest

  protected JndiReply invokeReadRequest(RequestContext reqCtx)
    throws NamingException {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "RequestManager.invokeReadRequest(" + reqCtx + ')');
    JndiRequest request = reqCtx.getRequest();
    if (request instanceof LookupRequest) {
      Object obj = lookup((LookupRequest)request);
      if (obj != null) {
        ObjectRecord or = (ObjectRecord)obj;
        return new LookupReply(or.getObject());
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.JndiRequest

    throws NamingException {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "RequestManager.invokeWriteRequest(" + reqCtx + ',' + ')');
    try {
      JndiRequest request = reqCtx.getRequest();

      if (request instanceof BindRequest) {
        bind((BindRequest)request);       
        return new JndiReply();
      } else if (request instanceof UnbindRequest) {
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.JndiRequest

        reqCtx);
    }
  }

  protected JndiReply invokeAdminRequest(RequestContext reqCtx) throws NamingException {
    JndiRequest request = reqCtx.getRequest();
   
    if (request instanceof ChangeOwnerRequest) {
      changeOwner((ChangeOwnerRequest)request);
      return new JndiReply();
    }
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.JndiRequest

                                  RequestContext reqCtx) {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "ReplicationManager.invokeOwner(" +
                       owner + ',' + reqCtx + ')');
    JndiRequest request = reqCtx.getRequest();   
    if (request instanceof CreateSubcontextRequest) {
      CreateSubcontextRequest csr =
        (CreateSubcontextRequest)request;
      request = new CreateRemoteSubcontextRequest(
                                                  csr.getName(),
View Full Code Here

Examples of org.apache.openejb.client.JNDIRequest

        }
    }

    public void processRequest(ObjectInputStream in, ObjectOutputStream out) {
        JNDIResponse res = new JNDIResponse();
        JNDIRequest req = null;
        try {
            req = new JNDIRequest();
            req.readExternal(in);
        } catch (Throwable e) {
            res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
            NamingException namingException = new NamingException("Could not read jndi request");
            namingException.setRootCause(e);
            res.setResult(namingException);

            if (logger.isDebugEnabled()){
                try {
                    logger.debug("JNDI REQUEST: "+req+" -- RESPONSE: " + res);
                } catch (Exception justInCase) {}
            }

            try {
                res.writeExternal(out);
            } catch (java.io.IOException ie) {
                logger.fatal("Couldn't write JndiResponse to output stream", ie);
            }
        }

        try {
            String name = req.getRequestString();
            if (name.startsWith("/")) name = name.substring(1);

            Object object = null;
            try {
                if (req.getModuleId() != null && req.getModuleId().equals("openejb/Deployment")){

                    object = deploymentsJndiTree.lookup(name);

                } else if (req.getModuleId() != null && clientJndiTree != null) {

                    Context moduleContext = (Context) clientJndiTree.lookup(req.getModuleId());

                    if (name.startsWith("comp/env/")) {

                        Context ctx = (Context) moduleContext.lookup("comp");
                        ctx = (Context) ctx.lookup("env");
View Full Code Here

Examples of org.apache.openejb.client.JNDIRequest

        return new BasicClusterableRequestHandler();
    }

    public void processRequest(ObjectInputStream in, ObjectOutputStream out) {
        JNDIResponse res = new JNDIResponse();
        JNDIRequest req = null;
        try {
            req = new JNDIRequest();
            req.readExternal(in);
        } catch (Throwable e) {
            res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
            NamingException namingException = new NamingException("Could not read jndi request");
            namingException.setRootCause(e);
            res.setResult(new ThrowableArtifact(namingException));

            if (logger.isDebugEnabled()) {
                try {
                    logger.debug("JNDI REQUEST: " + req + " -- RESPONSE: " + res);
                } catch (Exception ignore) {
                }
            }

            try {
                res.writeExternal(out);
            } catch (java.io.IOException ie) {
                logger.fatal("Couldn't write JndiResponse to output stream", ie);
            }
        }

        try {
            if (req.getRequestString().startsWith("/")) {
                req.setRequestString(req.getRequestString().substring(1));
            }
            String prefix = getPrefix(req);

            switch (req.getRequestMethod()) {
                case JNDI_LOOKUP:
                    doLookup(req, res, prefix);
                    break;
                case JNDI_LIST:
                    doList(req, res, prefix);
View Full Code Here

Examples of org.apache.openejb.client.JNDIRequest

        return new BasicClusterableRequestHandler();
    }

    public void processRequest(ObjectInputStream in, ObjectOutputStream out) {
        JNDIResponse res = new JNDIResponse();
        JNDIRequest req = null;
        try {
            req = new JNDIRequest();
            req.readExternal(in);
        } catch (Throwable e) {
            res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
            NamingException namingException = new NamingException("Could not read jndi request");
            namingException.setRootCause(e);
            res.setResult(new ThrowableArtifact(namingException));

            if (logger.isDebugEnabled()){
                try {
                    logger.debug("JNDI REQUEST: "+req+" -- RESPONSE: " + res);
                } catch (Exception justInCase) {}
            }

            try {
                res.writeExternal(out);
            } catch (java.io.IOException ie) {
                logger.fatal("Couldn't write JndiResponse to output stream", ie);
            }
        }

        try {
            if (req.getRequestString().startsWith("/")) {
                req.setRequestString(req.getRequestString().substring(1));
            }
            Context context = getContext(req);

            switch(req.getRequestMethod()){
                case RequestMethodConstants.JNDI_LOOKUP: doLookup(req, res, context); break;
                case RequestMethodConstants.JNDI_LIST: doList(req, res, context); break;
            }

        } catch (Throwable e) {
View Full Code Here

Examples of org.apache.openejb.client.JNDIRequest

    }

    @Override
    public Response processRequest(final ObjectInputStream in, final ProtocolMetaData metaData) {

        final JNDIRequest req = new JNDIRequest();
        final JNDIResponse res = new JNDIResponse();
        res.setRequest(req);

        try {
            req.setMetaData(metaData);
            req.readExternal(in);
        } catch (Throwable e) {
            res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
            final NamingException namingException = new NamingException("Could not read jndi request");
            namingException.setRootCause(e);
            res.setResult(new ThrowableArtifact(namingException));
View Full Code Here

Examples of org.apache.openejb.client.JNDIRequest

    public void processResponse(final Response response, final ObjectOutputStream out, final ProtocolMetaData metaData) throws Exception {

        if (JNDIResponse.class.isInstance(response)) {

            final JNDIResponse res = (JNDIResponse) response;
            final JNDIRequest req = res.getRequest();

            try {

                //Only process if 'processRequest' was ok...
                final Object result = res.getResult();
                if (null == result || !ThrowableArtifact.class.isInstance(result)) {

                    if (req.getRequestString().startsWith("/")) {
                        req.setRequestString(req.getRequestString().substring(1));
                    }

                    final String prefix = getPrefix(req);

                    switch (req.getRequestMethod()) {
                        case JNDI_LOOKUP:
                            doLookup(req, res, prefix);
                            break;
                        case JNDI_LIST:
                            doList(req, res, prefix);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.