Examples of SecurityService


Examples of org.apache.openejb.spi.SecurityService

        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(getBeanContext().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();
                }
            }
            IntraVmCopyMonitor.State oldStrategy =  strategy;
            if (getBeanContext().isAsynchronous(method) || getBeanContext().getComponentType().equals(BeanType.MANAGED)){
                strategy = IntraVmCopyMonitor.State.NONE;
            }
  
            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 {
                strategy = oldStrategy;
            }
        } finally {
           
            if (callContext == null && localClientIdentity != null) {
                SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
                securityService.disassociate();
            }
        }
    }
View Full Code Here

Examples of org.apache.openejb.spi.SecurityService

                        logger.debug("startup.debugEntry", entry);
                    }
                }
            }

            SecurityService securityService = assembler.getSecurityService();
            if (securityService == null) {
                String msg = messages.message("startup.assemblerReturnedNullSecurityService");
                logger.fatal(msg);
                throw new OpenEJBException(msg);
            } else {
                logger.debug("startup.securityService", securityService.getClass().getName());
            }
            system.setComponent(SecurityService.class, securityService);

            TransactionManager transactionManager = assembler.getTransactionManager();
            if (transactionManager == null) {
View Full Code Here

Examples of org.apache.turbine.services.security.SecurityService

        return new TestSuite(TestTorqueSecurity.class);
    }

    public void testInit()
    {
        SecurityService ss = TurbineSecurity.getService();

        assertEquals("No Torque Security Service", ss.getClass(), TorqueSecurityService.class);
        assertEquals("No Torque User Manager", ss.getUserManager().getClass(), TorqueUserManager.class);
        assertTrue("Service failed to initialize", ss.getInit());
    }
View Full Code Here

Examples of org.apache.webbeans.spi.SecurityService

        if (webBeansContext == null)
        {
            webBeansContext = WebBeansContext.currentInstance();
        }

        SecurityService securityService = webBeansContext.getService(SecurityService.class);
        if(securityService == null)
        {
            return null;
        }
        else
        {
            return securityService.getCurrentPrincipal();
        }
    }
View Full Code Here

Examples of org.apache.webbeans.spi.SecurityService

    //from StandaloneResourceInjectionService
    @Override
    public void injectJavaEEResources(Object managedBeanInstance) {
        Class<?> currentClass = managedBeanInstance.getClass();
       
        SecurityService securityService = webBeansContext.getSecurityService();
        while (currentClass != null && Object.class != currentClass) {
            Field[] fields = securityService.doPrivilegedGetDeclaredFields(currentClass);

            for (Field field : fields) {
                if (Modifier.isStatic(field.getModifiers())) continue;

                Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());

                if (ann == null) continue;

                @SuppressWarnings("unchecked")
                ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(), field.getName(), field.getType(), ann);
                boolean acess = field.isAccessible();
                try {
                    securityService.doPrivilegedSetAccessible(field, true);
                    field.set(managedBeanInstance, getResourceReference(resourceRef));
                } catch (Exception e) {
                    throw new WebBeansException("Unable to inject field" + field, e);
                } finally {
                    securityService.doPrivilegedSetAccessible(field, acess);
                }
            }
            currentClass = currentClass.getSuperclass();
        }
    }
View Full Code Here

Examples of org.hudsonci.service.SecurityService

    @Before
    public void setUp() throws Exception {
        mockStatic(Hudson.class);
        hudson = mock(Hudson.class);

        SecurityService security = mock(SecurityService.class);
        system = new SystemServiceImpl(security);
        system.setHudson(hudson);
    }
View Full Code Here

Examples of org.jboss.ballroom.client.rbac.SecurityService

        refreshPlainView();
    }

    @Override
    public Set<String> getReadOnlyNames() {
        SecurityService securityFacilities = framework.getSecurityService();
        SecurityContext securityContext = securityFacilities.getSecurityContext();

        if(resourceAddress !=null)
        {
            return securityFacilities.getReadOnlyJavaNames(conversionType, resourceAddress, securityContext);
        }
        else
        {
            return securityFacilities.getReadOnlyJavaNames(getConversionType(), securityContext);
        }
    }
View Full Code Here

Examples of org.jboss.ballroom.client.rbac.SecurityService

        refreshPlainView();
    }

    @Override
    public Set<String> getReadOnlyNames() {
        SecurityService securityFacilities = framework.getSecurityService();
        SecurityContext securityContext = securityFacilities.getSecurityContext();

        if(resourceAddress !=null)
        {
            return securityFacilities.getReadOnlyJavaNames(conversionType, resourceAddress, securityContext);
        }
        else
        {
            return securityFacilities.getReadOnlyJavaNames(getConversionType(), securityContext);
        }
    }
View Full Code Here

Examples of org.jboss.errai.bus.client.security.SecurityService

  public Application()
  {
    bus.setLogAdapter(logAdapter);
   
    authenticationModule = new AuthenticationModule();
    securityService = new SecurityService();

    // global service registry
    Registry.set(SecurityService.class, securityService);
    Registry.set(AuthenticationModule.class, authenticationModule);
    Registry.set(Preferences.class, GWT.create(Preferences.class));
View Full Code Here

Examples of org.jboss.soa.esb.services.security.SecurityService

                         */
                    LOGGER.debug(securityContext);
                    }
                }

          final SecurityService securityService = SecurityServiceFactory.getSecurityService();

          final String moduleName = securityConf.getModuleName() ;
            if (securityContext == null || !securityContext.isValid() || ((moduleName != null) && !moduleName.equals(securityContext.getDomain())))
            {
                if (authRequest == null)
                {
                    throw new SecurityServiceException("Service '" + serviceName + "' has been configured for security but no AuthenticationRequest could be located in the Message Context. Cannot authenticate without an AuthenticationRequest.");
                }

                 // No existing security context exist or it had expired. Create a new one to drive the autentication.
                securityContext = new SecurityContext(new Subject(), getSecurityContextTimeout(securityConf), moduleName);

                // Authenticate the caller
              securityService.authenticate(securityConf, securityContext, authRequest);

                // Store the encrypted security context. Will be re-attached to outgoing messages.
              SecurityContext.setSecurityContext(SecurityContext.encryptContext(securityContext));
            }

            // Check that the caller is a member of atleast one of the declared roles.
            if (!securityService.checkRolesAllowed(securityConf.getRolesAllowed(), securityContext))
            {
              throw new SecurityServiceException("Caller did not belong to any of the rolesAllowed " + securityConf.getRolesAllowed());
            }
        }
    }
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.