Examples of Scoping


Examples of com.google.inject.internal.Scoping

    public static Class<? extends Annotation> getScopeAnnotation(
            Binding<?> binding) {
        Class<? extends Annotation> scopeAnnotation = null;
        if (binding instanceof BindingImpl) {
            BindingImpl bindingImpl = (BindingImpl) binding;
            Scoping scoping = bindingImpl.getScoping();
            if (scoping != null) {
                scopeAnnotation = scoping.getScopeAnnotation();

                // TODO not sure why we need this hack???
                if (scopeAnnotation == null) {
                    Scope scope = scoping.getScopeInstance();
                    if (scope instanceof HasScopeAnnotation) {
                        HasScopeAnnotation hasScopeAnnotation = (HasScopeAnnotation) scope;
                        scopeAnnotation = hasScopeAnnotation
                                .getScopeAnnotation();
                    }
View Full Code Here

Examples of com.google.inject.internal.Scoping

    }
   
    @Test
    public void itBindsAHibernateInitializerAsAnEagerSingleton() throws Exception {
      final Map<Key<?>, Object> bindings = getBindings(module);
      final Scoping scoping = (Scoping) bindings.get(Key.get(HibernateInitializer.class));
     
      assertThat(scoping, is(Scoping.EAGER_SINGLETON));
    }
View Full Code Here

Examples of com.google.inject.internal.Scoping

      return true;
    }

    validateKey(command.getSource(), command.getKey());

    final Scoping scoping = Scopes.makeInjectable(
        ((BindingImpl<?>) command).getScoping(), injector, errors);

    command.acceptTargetVisitor(new BindingTargetVisitor<T, Void>() {

      public Void visitInstance(InstanceBinding<? extends T> binding) {
View Full Code Here

Examples of com.google.inject.internal.Scoping

  public Object getInstance(GuiceBean bean, Object context) throws InvocationTargetException {
    return context;
  }

  public void releaseContext(GuiceBean bean, Object context) {
    Scoping scoping = ((BindingImpl)bean.binding).getScoping();
    if (scoping.isNoScope()) {
      invokePreDestroy(context);
    }
  }
View Full Code Here

Examples of com.google.inject.internal.Scoping

    }
  }

  public void close() {
    for (Binding<?> binding : injector.getAllBindings().values()) {
      Scoping scoping = ((BindingImpl)binding).getScoping();
      if (scoping == Scoping.SINGLETON_INSTANCE) {
        invokePreDestroy(binding.getProvider().get());
      }
    }
  }
View Full Code Here

Examples of org.opensaml.saml2.core.Scoping

    Client client = getClientByRequest(authState);
    String spEntityIdBy = client.getAttributes().get(CLIENT_SAML_ENTITY_NAME);

    if (StringUtils.isNotEmpty(spEntityIdBy)) {
      Scoping scoping = scopingBuilder.buildObject();
      scoping.getRequesterIDs().add(createRequesterID(spEntityIdBy));
      authnRequest.setScoping(scoping);
    } else {
      LOG.warn("For Client {} there is no key CLIENT_SAML_ENTITY_NAME configured to identify the SP entity name. NO SCOPING IS APPLIED", client.getClientId());
    }
View Full Code Here

Examples of org.opensaml.saml2.core.Scoping

*/
public class ScopingMarshaller extends AbstractSAMLObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        Scoping scoping = (Scoping) samlObject;

        if (scoping.getProxyCount() != null) {
            domElement.setAttributeNS(null, Scoping.PROXY_COUNT_ATTRIB_NAME, scoping.getProxyCount().toString());
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.Scoping

*/
public class ScopingUnmarshaller extends AbstractSAMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        Scoping scoping = (Scoping) samlObject;

        if (attribute.getLocalName().equals(Scoping.PROXY_COUNT_ATTRIB_NAME)) {
            scoping.setProxyCount(Integer.valueOf(attribute.getValue()));
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.Scoping

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        Scoping scoping = (Scoping) parentSAMLObject;
        if (childSAMLObject instanceof IDPList) {
            scoping.setIDPList((IDPList) childSAMLObject);
        } else if (childSAMLObject instanceof RequesterID) {
            scoping.getRequesterIDs().add((RequesterID) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.Scoping

        super(namespaceURI, elementLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        Scoping scoping = (Scoping) samlObject;

        if (scoping.getProxyCount() != null)
            domElement.setAttributeNS(null, Scoping.PROXY_COUNT_ATTRIB_NAME, scoping.getProxyCount().toString());
    }
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.