Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.OutboundResourceAdapter


     * cannot be loaded   
     */
    protected Class getManagedConnectionFactoryImpl(ConnectorDescriptor descriptor)
        throws ClassNotFoundException
    {
      OutboundResourceAdapter outboundRA =
        descriptor.getOutboundResourceAdapter();
      if(outboundRA == null)
      {
        return null;
      }
      Set connDefs = outboundRA.getConnectionDefs();
      Iterator iter = connDefs.iterator();
      while(iter.hasNext())
      {
        ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
          iter.next();
View Full Code Here


        Class c = (Class) element.getAnnotatedElement();
        String targetClassName = c.getName();
        if (ManagedConnectionFactory.class.isAssignableFrom(c)) {

            if (!desc.getOutBoundDefined()) {
                OutboundResourceAdapter ora = new OutboundResourceAdapter();
                desc.setOutboundResourceAdapter(ora);
            }

            OutboundResourceAdapter ora = desc.getOutboundResourceAdapter();

            if (!ora.hasConnectionDefDescriptor(connDefn.connectionFactory().getName())) {
                ConnectionDefDescriptor cdd = new ConnectionDefDescriptor();
                cdd.setConnectionFactoryImpl(connDefn.connectionFactoryImpl().getName());
                cdd.setConnectionFactoryIntf(connDefn.connectionFactory().getName());
                cdd.setConnectionIntf(connDefn.connection().getName());
                cdd.setConnectionImpl(connDefn.connectionImpl().getName());

                cdd.setManagedConnectionFactoryImpl(targetClassName);

                ora.addConnectionDefDescriptor(cdd);
            }// else {
                // ignore the duplicates
                // duplicates can be via :
                // (i) connection-definition defined in DD
                // (ii) as part of this particular annotation processing,
View Full Code Here

     */
    public AuthenticationService getAuthenticationService(String rarName,
                                                          PoolInfo poolInfo) {

        ConnectorDescriptor cd = _registry.getDescriptor(rarName);
        OutboundResourceAdapter obra = cd.getOutboundResourceAdapter();
        Set authMechs = obra.getAuthMechanisms();
        for (Object authMech : authMechs) {
            AuthMechanism authMechanism = (AuthMechanism) authMech;
            String mech = authMechanism.getAuthMechType();
            if (mech.equals("BasicPassword")) {
                return new BasicPasswordAuthenticationService(rarName, poolInfo);
View Full Code Here

                // check whether the same auth-mechanism is defined in DD also,
                // possible change could be with auth-mechanism's credential-interface for a particular
                // auth-mechanism-type
                boolean ignore = false;
                OutboundResourceAdapter ora = getOutbound(desc);
                Set ddAuthMechanisms = ora.getAuthMechanisms();

                for (Object o : ddAuthMechanisms) {
                    AuthMechanism ddAuthMechanism = (AuthMechanism) o;
                    if (ddAuthMechanism.getAuthMechType().equals(auth.authMechanism())) {
                        ignore = true;
                        break;
                    }
                }

                // if it was not specified in DD, add it to connector-descriptor
                if (!ignore) {
                    String credentialInterfaceName = ora.getCredentialInterfaceName(auth.credentialInterface());
                    //XXX: Siva: For now use the first provided description
                    String description = "";
                    if(auth.description().length > 0){
                        description = auth.description()[0];
                    }
                    AuthMechanism authM = new AuthMechanism(description, authMechInt, credentialInterfaceName);
                    ora.addAuthMechanism(authM);
                }
            }
        }

        // merge DD and annotation entries of security-permission
        SecurityPermission[] perms = connector.securityPermissions();
        if (perms != null && perms.length > 0) {
            for (SecurityPermission perm : perms) {
                boolean ignore = false;
                // check whether the same permission is defined in DD also,
                // though it does not make any functionality difference except possible
                // "Description" change
                Set ddSecurityPermissions = desc.getSecurityPermissions();
                for (Object o : ddSecurityPermissions) {
                    com.sun.enterprise.deployment.SecurityPermission ddSecurityPermission =
                            (com.sun.enterprise.deployment.SecurityPermission) o;
                    if (ddSecurityPermission.getPermission().equals(perm.permissionSpec())) {
                        ignore = true;
                        break;
                    }
                }

                // if it was not specified in DD, add it to connector-descriptor
                if (!ignore) {
                    com.sun.enterprise.deployment.SecurityPermission sp =
                            new com.sun.enterprise.deployment.SecurityPermission();
                    sp.setPermission(perm.permissionSpec());
                    //XXX: Siva for now use the first provided Description
                    String firstDesc = "";
                    if(perm.description().length > 0) firstDesc = perm.description()[0];
                    sp.setDescription(firstDesc);
                    desc.addSecurityPermission(sp);
                }
            }
        }

        //we should not create outbound resource adapter unless it is required.
        //this is necessary as the default value processing in the annotation may
        //result in outbound to be defined without any connection-definition which is an issue.

        //if reauth is false, we can ignore it as default value in dol is also false.
        if(connector.reauthenticationSupport()){
            OutboundResourceAdapter ora = getOutbound(desc);
            if(!ora.isReauthenticationSupportSet()){
                ora.setReauthenticationSupport(connector.reauthenticationSupport());
            }
        }
        //if transaction-support is no-transaction, we can ignore it as default value in dol is also no-transaction.
        if(!connector.transactionSupport().equals(TransactionSupport.TransactionSupportLevel.NoTransaction)){
            OutboundResourceAdapter ora = getOutbound(desc);
            if(!ora.isTransactionSupportSet()){
                ora.setTransactionSupport(connector.transactionSupport().toString());
            }
        }

        //merge the DD & annotation specified values of required-inflow-contexts
        //merge involves simple union of class-names of inflow-contexts of DD and annotation
View Full Code Here

        return null;
    }

    public static OutboundResourceAdapter getOutbound(ConnectorDescriptor desc) {
        if (!desc.getOutBoundDefined()) {
            desc.setOutboundResourceAdapter(new OutboundResourceAdapter());
        }
        return desc.getOutboundResourceAdapter();
    }
View Full Code Here

            boolean isConnectionDefinition = hasConnectorAnnotation(element);
            if (isConnectionDefinition) {
                RarBundleContext rarContext = (RarBundleContext) aeHandler;
                ConnectorDescriptor desc = rarContext.getDescriptor();
                if (!desc.getOutBoundDefined()) {
                    OutboundResourceAdapter ora = new OutboundResourceAdapter();
                    desc.setOutboundResourceAdapter(ora);
                }
                OutboundResourceAdapter ora = desc.getOutboundResourceAdapter();
                String[] description = authMechanism.description();
                int authMechanismValue = getAuthMechVal(authMechanism.authMechanism());
                AuthenticationMechanism.CredentialInterface ci = authMechanism.credentialInterface();
                String credentialInterface = ora.getCredentialInterfaceName(ci);
                //XXX: Siva: For now use the first description
                String firstDesc = "";
                if(description.length > 0) {
                    firstDesc = description[0];
                }
                AuthMechanism auth = new AuthMechanism(firstDesc, authMechanismValue, credentialInterface);
                ora.addAuthMechanism(auth);
            } else {
                getFailureResult(element, "Not a @Connector annotation : @AuthenticationMechanism must " +
                        "be specified along with @Connector annotation", true);
            }
        } else {
View Full Code Here

            boolean isConnectionDefinition = hasConnectorAnnotation(element);
            if (isConnectionDefinition) {
                RarBundleContext rarContext = (RarBundleContext) aeHandler;
                ConnectorDescriptor desc = rarContext.getDescriptor();
                if (!desc.getOutBoundDefined()) {
                    OutboundResourceAdapter ora = new OutboundResourceAdapter();
                    desc.setOutboundResourceAdapter(ora);
                }
                OutboundResourceAdapter ora = desc.getOutboundResourceAdapter();
                String[] description = authMechanism.description();
                int authMechanismValue = getAuthMechVal(authMechanism.authMechanism());
                AuthenticationMechanism.CredentialInterface ci = authMechanism.credentialInterface();
                String credentialInterface = ora.getCredentialInterfaceName(ci);
                //XXX: Siva: For now use the first description
                String firstDesc = "";
                if(description.length > 0) {
                    firstDesc = description[0];
                }
                AuthMechanism auth = new AuthMechanism(firstDesc, authMechanismValue, credentialInterface);
                ora.addAuthMechanism(auth);
            } else {
                getFailureResult(element, "Not a @Connector annotation : @AuthenticationMechanism must " +
                        "be specified along with @Connector annotation", true);
            }
        } else {
View Full Code Here

        Class c = (Class) element.getAnnotatedElement();
        String targetClassName = c.getName();
        if (ManagedConnectionFactory.class.isAssignableFrom(c)) {

            if (!desc.getOutBoundDefined()) {
                OutboundResourceAdapter ora = new OutboundResourceAdapter();
                desc.setOutboundResourceAdapter(ora);
            }

            OutboundResourceAdapter ora = desc.getOutboundResourceAdapter();

            if (!ora.hasConnectionDefDescriptor(connDefn.connectionFactory().getName())) {
                ConnectionDefDescriptor cdd = new ConnectionDefDescriptor();
                cdd.setConnectionFactoryImpl(connDefn.connectionFactoryImpl().getName());
                cdd.setConnectionFactoryIntf(connDefn.connectionFactory().getName());
                cdd.setConnectionIntf(connDefn.connection().getName());
                cdd.setConnectionImpl(connDefn.connectionImpl().getName());

                cdd.setManagedConnectionFactoryImpl(targetClassName);

                ora.addConnectionDefDescriptor(cdd);
            }// else {
                // ignore the duplicates
                // duplicates can be via :
                // (i) connection-definition defined in DD
                // (ii) as part of this particular annotation processing,
View Full Code Here

                // check whether the same auth-mechanism is defined in DD also,
                // possible change could be with auth-mechanism's credential-interface for a particular
                // auth-mechanism-type
                boolean ignore = false;
                OutboundResourceAdapter ora = getOutbound(desc);
                Set ddAuthMechanisms = ora.getAuthMechanisms();

                for (Object o : ddAuthMechanisms) {
                    AuthMechanism ddAuthMechanism = (AuthMechanism) o;
                    if (ddAuthMechanism.getAuthMechType().equals(auth.authMechanism())) {
                        ignore = true;
                        break;
                    }
                }

                // if it was not specified in DD, add it to connector-descriptor
                if (!ignore) {
                    String credentialInterfaceName = ora.getCredentialInterfaceName(auth.credentialInterface());
                    //XXX: Siva: For now use the first provided description
                    String description = "";
                    if(auth.description().length > 0){
                        description = auth.description()[0];
                    }
                    AuthMechanism authM = new AuthMechanism(description, authMechInt, credentialInterfaceName);
                    ora.addAuthMechanism(authM);
                }
            }
        }

        // merge DD and annotation entries of security-permission
        SecurityPermission[] perms = connector.securityPermissions();
        if (perms != null && perms.length > 0) {
            for (SecurityPermission perm : perms) {
                boolean ignore = false;
                // check whether the same permission is defined in DD also,
                // though it does not make any functionality difference except possible
                // "Description" change
                Set ddSecurityPermissions = desc.getSecurityPermissions();
                for (Object o : ddSecurityPermissions) {
                    com.sun.enterprise.deployment.SecurityPermission ddSecurityPermission =
                            (com.sun.enterprise.deployment.SecurityPermission) o;
                    if (ddSecurityPermission.getPermission().equals(perm.permissionSpec())) {
                        ignore = true;
                        break;
                    }
                }

                // if it was not specified in DD, add it to connector-descriptor
                if (!ignore) {
                    com.sun.enterprise.deployment.SecurityPermission sp =
                            new com.sun.enterprise.deployment.SecurityPermission();
                    sp.setPermission(perm.permissionSpec());
                    //XXX: Siva for now use the first provided Description
                    String firstDesc = "";
                    if(perm.description().length > 0) firstDesc = perm.description()[0];
                    sp.setDescription(firstDesc);
                    desc.addSecurityPermission(sp);
                }
            }
        }

        //we should not create outbound resource adapter unless it is required.
        //this is necessary as the default value processing in the annotation may
        //result in outbound to be defined without any connection-definition which is an issue.

        //if reauth is false, we can ignore it as default value in dol is also false.
        if(connector.reauthenticationSupport()){
            OutboundResourceAdapter ora = getOutbound(desc);
            if(!ora.isReauthenticationSupportSet()){
                ora.setReauthenticationSupport(connector.reauthenticationSupport());
            }
        }
        //if transaction-support is no-transaction, we can ignore it as default value in dol is also no-transaction.
        if(!connector.transactionSupport().equals(TransactionSupport.TransactionSupportLevel.NoTransaction)){
            OutboundResourceAdapter ora = getOutbound(desc);
            if(!ora.isTransactionSupportSet()){
                ora.setTransactionSupport(connector.transactionSupport().toString());
            }
        }

        //merge the DD & annotation specified values of required-inflow-contexts
        //merge involves simple union of class-names of inflow-contexts of DD and annotation
View Full Code Here

        return null;
    }

    public static OutboundResourceAdapter getOutbound(ConnectorDescriptor desc) {
        if (!desc.getOutBoundDefined()) {
            desc.setOutboundResourceAdapter(new OutboundResourceAdapter());
        }
        return desc.getOutboundResourceAdapter();
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.OutboundResourceAdapter

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.