Package org.apache.openejb.spi

Examples of org.apache.openejb.spi.SecurityService


        assertSame(springTM, initialContext.lookup("openejb/TransactionManager"));

        //
        // SecurityService
        //
        SecurityService springSecurityService = (SecurityService) context.getBean("sec");
        assertNotNull("springSecurityService is null", springSecurityService);
        assertTrue("springSecurityService should be an instance of MockSecurityService", springSecurityService instanceof MockSecurityService);

        SecurityService systemSecurityService = SystemInstance.get().getComponent(SecurityService.class);
        assertNotNull("systemSecurityService is null", systemSecurityService);
        assertSame(springSecurityService, systemSecurityService);

        assertSame(springSecurityService, initialContext.lookup("openejb/SecurityService"));
View Full Code Here


        ThreadContext callContext = ThreadContext.getThreadContext();
        Object localClientIdentity = ClientSecurity.getIdentity();
        try {
            if (callContext == null && localClientIdentity != null) {
                SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
                securityService.associate(localClientIdentity);
            }
            if (strategy == CLASSLOADER_COPY) {

                IntraVmCopyMonitor.pre(strategy);
                ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(getDeploymentInfo().getClassLoader());
                try {
                    args = copyArgs(args);
                    method = copyMethod(method);
                    interfce = copyObj(interfce);
                } finally {
                    Thread.currentThread().setContextClassLoader(oldClassLoader);
                    IntraVmCopyMonitor.post();
                }

            } else if (strategy == COPY && args != null && args.length > 0) {

                IntraVmCopyMonitor.pre(strategy);
                try {
                    args = copyArgs(args);
                } finally {
                    IntraVmCopyMonitor.post();
                }
            }

            try {

                Object returnValue = _invoke(proxy, interfce, method, args);

                return copy(strategy, returnValue);
            } catch (Throwable throwable) {
                throwable = copy(strategy, throwable);
                throw convertException(throwable, method, interfce);
            }
        } finally {
            if (callContext == null && localClientIdentity != null) {
                SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
                securityService.disassociate();
            }
        }
    }
View Full Code Here

        String pass = (String) env.get(Context.SECURITY_CREDENTIALS);
        String realmName = (String) env.get("openejb.authentication.realmName");

        if (user != null && pass != null){
            try {
                SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
                Object identity = null;
                if (realmName == null) {
                    identity = securityService.login(user, pass);
                } else {
                    identity = securityService.login(realmName, user, pass);
                }
                securityService.associate(identity);
            } catch (LoginException e) {
                throw (AuthenticationException) new AuthenticationException("User could not be authenticated: "+user).initCause(e);
            }
        }
View Full Code Here

        transactionServiceInfo.id = "Default Transaction Manager";
        transactionServiceInfo.service = "TransactionManager";
        assembler.createTransactionManager(transactionServiceInfo);

        // install security service
        SecurityService securityService = new GeronimoSecurityService();
        SecurityServiceInfo securityServiceInfo = new SecurityServiceInfo();
        PassthroughFactory.add(securityServiceInfo, securityService);
        securityServiceInfo.id = "Default Security Service";
        securityServiceInfo.service = "SecurityService";
        assembler.createSecurityService(securityServiceInfo);
View Full Code Here

        transactionServiceInfo.id = "Default Transaction Manager";
        transactionServiceInfo.serviceType = "TransactionManager";
        assembler.createTransactionManager(transactionServiceInfo);

        // install security service
        SecurityService securityService = new GeronimoSecurityService();
        SecurityServiceInfo securityServiceInfo = new SecurityServiceInfo();
        PassthroughFactory.add(securityServiceInfo, securityService);
        securityServiceInfo.id = "Default Security Service";
        securityServiceInfo.serviceType = "SecurityService";
        assembler.createSecurityService(securityServiceInfo);
View Full Code Here

            final String securityRealm = req.getRealm();
            final String username = req.getUsername();
            final String password = req.getCredentials();

            final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
            final Object token = securityService.login(securityRealm, username, password);

            final ClientMetaData client = new ClientMetaData();
            client.setMetaData(metaData);
            client.setClientIdentity(token);
View Full Code Here

        serviceRegistry.getStartedService(NetworkConnectorTracker.NAME);
        modify().multiplicity(expect.from(0));
        tracker = (NetworkConnectorTracker) mock(NetworkConnectorTracker.class);
        modify().returnValue(tracker);

        SecurityService securityService = (SecurityService) mock(SecurityService.class);
        container = (ClusteredStatefulContainer) intercept(ClusteredStatefulContainer.class, new Object[] {"id",
                securityService});
        deploymentId = "deploymentId";
        deploymentInfo = new CoreDeploymentInfo(new DeploymentContext(deploymentId, null, null),
            SFSB.class,
View Full Code Here

      SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());

        SystemInstance.get().setComponent(InboundRecovery.class, new GeronimoInboundRecovery(transactionManager));

        // install security service
        SecurityService securityService = new GeronimoSecurityService();
        SecurityServiceInfo securityServiceInfo = new SecurityServiceInfo();
        PassthroughFactory.add(securityServiceInfo, securityService);
        securityServiceInfo.id = "Default Security Service";
        securityServiceInfo.service = "SecurityService";
        assembler.createSecurityService(securityServiceInfo);
View Full Code Here

        serviceRegistry.getStartedService(NetworkConnectorTracker.NAME);
        modify().multiplicity(expect.from(0));
        tracker = (NetworkConnectorTracker) mock(NetworkConnectorTracker.class);
        modify().returnValue(tracker);

        SecurityService securityService = (SecurityService) mock(SecurityService.class);
        container = (ClusteredStatelessContainer) intercept(ClusteredStatelessContainer.class, new Object[] {"id",
                securityService,500,10,10,true});
        deploymentId = "deploymentId";
        deploymentInfo = new CoreDeploymentInfo(new DeploymentContext(deploymentId, null, null),
            SFSB.class,
View Full Code Here

      SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());

        SystemInstance.get().setComponent(InboundRecovery.class, new GeronimoInboundRecovery(transactionManager));

        // install security service
        SecurityService securityService = new GeronimoSecurityService();
        SecurityServiceInfo securityServiceInfo = new SecurityServiceInfo();
        PassthroughFactory.add(securityServiceInfo, securityService);
        securityServiceInfo.id = "Default Security Service";
        securityServiceInfo.service = "SecurityService";
        assembler.createSecurityService(securityServiceInfo);
View Full Code Here

TOP

Related Classes of org.apache.openejb.spi.SecurityService

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.