Package org.apache.openejb.client

Examples of org.apache.openejb.client.ServerMetaData


        requestHandler.updateServer(beanContext, request, response);
    }

    public void testServerIsNotUpdatedWhenRequestHashEqualsServerSideHash() throws Exception {
        URI[] locations = new URI[] {new URI("ejbd://localhost:4201")};
        ServerMetaData server = new ServerMetaData(locations);

        beanContext.setContainer(clusteredContainer);

        request.getServerHash();
        modify().returnValue(server.buildHash());

        clusteredContainer.getLocations(beanContext);
        modify().returnValue(locations);

        startVerification();
View Full Code Here


    public ClientObjectFactory(EjbDaemon daemon, Properties props) {

        try {
            String uriString = props.getProperty("openejb.ejbd.uri", "foo://127.0.0.1:4201");
            this.defaultServerMetaData = new ServerMetaData(new URI(uriString));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        return new EJBObjectHandle(hanlder.createEJBObjectProxy());
    }

    private ServerMetaData getServerMetaData() {
        ServerMetaData serverMetaData = ClientObjectFactory.serverMetaData.get();
        if (serverMetaData == null){
            serverMetaData = defaultServerMetaData;
        }
        return serverMetaData;
    }
View Full Code Here

        } catch (UnsupportedCallbackException e) {
            throw (LoginException)new LoginException("Could not execute callbacks").initCause(e);
        }
        String userName = ((NameCallback)callbacks[0]).getName();
        String password = new String(((PasswordCallback)callbacks[1]).getPassword());
        identity = (SubjectId) ClientSecurity.directAuthentication(securityRealm, userName, password, new ServerMetaData(serverURI));
        return true;
    }
View Full Code Here

        } catch (UnsupportedCallbackException e) {
            throw (LoginException)new LoginException("Could not execute callbacks").initCause(e);
        }
        String userName = ((NameCallback)callbacks[0]).getName();
        String password = new String(((PasswordCallback)callbacks[1]).getPassword());
        identity = (SubjectId) ClientSecurity.directAuthentication(securityRealm, userName, password, new ServerMetaData(serverURI));
        return true;
    }
View Full Code Here

        } catch (UnsupportedCallbackException e) {
            throw (LoginException)new LoginException("Could not execute callbacks").initCause(e);
        }
        String userName = ((NameCallback)callbacks[0]).getName();
        String password = new String(((PasswordCallback)callbacks[1]).getPassword());
        identity = (SubjectId) ClientSecurity.directAuthentication(securityRealm, userName, password, new ServerMetaData(serverURI));
        return true;
    }
View Full Code Here

    public ClientObjectFactory(final EjbDaemon daemon, final Properties props) {

        String uriString = "foo://127.0.0.1:4201";
        try {
            uriString = (props.getProperty("openejb.ejbd.uri", uriString));
            this.defaultServerMetaData = new ServerMetaData(new URI(uriString));
        } catch (final Exception e) {
            EjbDaemon.logger.error("Failed to read 'openejb.ejbd.uri': " + uriString, e);
        }
    }
View Full Code Here

        return new EJBObjectHandle(handler.createEJBObjectProxy());
    }

    private ServerMetaData getServerMetaData() {
        ServerMetaData serverMetaData = ClientObjectFactory.serverMetaData.get();
        if (serverMetaData == null) {
            serverMetaData = defaultServerMetaData;
        }
        return serverMetaData;
    }
View Full Code Here

            final CountingInputStream cis = info.getInputStream();
            clientProtocol.readExternal(cis);
            ois = new EjbObjectInputStream(cis);

            // Read ServerMetaData
            final ServerMetaData serverMetaData = new ServerMetaData();
            serverMetaData.readExternal(ois);
            ClientObjectFactory.serverMetaData.set(serverMetaData);

            // Read request type
            requestTypeByte = ois.readByte();
            requestType = RequestType.valueOf(requestTypeByte);
View Full Code Here

        if (container instanceof ClusteredRPCContainer) {
            final ClusteredRPCContainer clusteredContainer = (ClusteredRPCContainer) container;
            final URI[] locations = clusteredContainer.getLocations(beanContext);
            if (null != locations) {
                final ServerMetaData server = new ServerMetaData(locations);
                if (req.getServerHash() != server.buildHash()) {
                    res.setServer(server);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.client.ServerMetaData

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.