Examples of Audit


Examples of org.apache.tuscany.sca.interfacedef.util.Audit

                     BuilderContext builderContext,
                     boolean runtime){
       
        logger.fine("Binding " + endpointReference.toString());
       
        Audit matchAudit = new Audit();
            
        // This logic does post build autowire matching but isn't actually used at the moment
        // as problems with dependencies mean we still do this during build
        if (endpointReference.getStatus() == EndpointReference.Status.AUTOWIRE_PLACEHOLDER){
          
            // do autowire matching
            // will only be called at build time at the moment
            Multiplicity multiplicity = endpointReference.getReference().getMultiplicity();
            for (Endpoint endpoint : endpointRegistry.getEndpoints()){
//              if (endpoint is in the same composite as endpoint reference){
                    if ((multiplicity == Multiplicity.ZERO_ONE ||
                         multiplicity == Multiplicity.ONE_ONE) &&
                        (endpointReference.getReference().getEndpointReferences().size() > 1)) {
                        break;
                    }

                    // Prevent autowire connecting to self
                    if (endpointReference.getComponent() ==
                        endpoint.getComponent()) {
                        continue;
                    }
                   
                    if (haveMatchingPolicy(endpointReference, endpoint, matchAudit, builderContext) &&
                        haveMatchingInterfaceContracts(endpointReference, endpoint, matchAudit)){
                        // matching service so find if this reference already has
                        // an endpoint reference for this endpoint
                        Endpoint autowireEndpoint = null;
                       
                        for (EndpointReference epr : endpointReference.getReference().getEndpointReferences()){
                            if (epr.getTargetEndpoint() == endpoint){
                                autowireEndpoint = endpoint;
                                break;
                            }
                        }
                       
                        if (autowireEndpoint == null){
                            // create new EPR for autowire
                            EndpointReference autowireEndpointRefrence = null;
                            try {
                                autowireEndpointRefrence = (EndpointReference)endpointReference.clone();
                            } catch (Exception ex){
                                // won't happen as clone is supported
                            }
                           
                            autowireEndpointRefrence.setTargetEndpoint(endpoint);
                            autowireEndpointRefrence.setBinding(endpoint.getBinding());
                            autowireEndpointRefrence.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
                            endpointReference.getReference().getEndpointReferences().add(autowireEndpointRefrence)
                        }
                    }
//              }
            }
           
            if (multiplicity == Multiplicity.ONE_N || multiplicity == Multiplicity.ONE_ONE) {
                if (endpointReference.getReference().getEndpointReferences().size() == 1) {
                    Monitor.error(monitor,
                                  this,
                                  "endpoint-validation-messages",
                                  "NoComponentReferenceTarget",
                                  endpointReference.getReference().getName());
                    throw new ServiceRuntimeException("Unable to bind " +
                                                      monitor.getLastProblem().toString());
                }
            }
           
            setSingleAutoWireTarget(endpointReference.getReference());
           
        } else if ( endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED||
                    endpointReference.getStatus() == EndpointReference.Status.RESOLVED_BINDING ) {
            // The endpoint reference is already resolved to either
            // a service endpoint local to this composite or it has
            // a remote binding
           
            // still need to check that the callback endpoint is set correctly
            if (hasCallback(endpointReference) &&
                (endpointReference.getCallbackEndpoint() == null
                    || endpointReference.getCallbackEndpoint().isUnresolved())) {
                selectCallbackEndpoint(endpointReference,
                                       endpointReference.getReference().getCallbackService(),
                                       matchAudit,
                                       builderContext,
                                       runtime);
            }
        } else if (endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_FOUND_READY_FOR_MATCHING ){
            // The endpoint reference is already resolved to either
            // a service endpoint but no binding was specified in the
            // target URL and/or the policies have yet to be matched.
            // TODO - is this really required now
           
            selectForwardEndpoint(endpointReference,
                                  endpointReference.getTargetEndpoint().getService().getEndpoints(),
                                  matchAudit,
                                  builderContext);

            if (hasCallback(endpointReference)){
                selectCallbackEndpoint(endpointReference,
                                       endpointReference.getReference().getCallbackService(),
                                       matchAudit,
                                       builderContext,
                                       runtime);
            }            
        } else if (endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_IN_BINDING_URI ||
                   endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_NOT_FOUND ||
                   endpointReference.getStatus() == EndpointReference.Status.NOT_CONFIGURED){
            // The reference is not yet matched to a service
         
            // find the service in the endpoint registry
            List<Endpoint> endpoints = endpointRegistry.findEndpoint(endpointReference);
           
            if (endpoints.size() > 0){
                selectForwardEndpoint(endpointReference,
                        endpoints,
                        matchAudit,
                        builderContext);

                // If the reference was matched try to match the callback
                if (endpointReference.getStatus().equals(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED) &&
                    hasCallback(endpointReference)){
                    selectCallbackEndpoint(endpointReference,
                                           endpointReference.getReference().getCallbackService(),
                                           matchAudit,
                                           builderContext,
                                           runtime);
                }
            } else if (runtime) {
                // tweak to test if this could be a resolved binding. This is the back end of the test
                // in the builder that pulls the URI out of the binding if there are no targets
                // on the reference. have to wait until here to see if the binding uri matches any
                // available services. If not we assume here that it's a resolved binding
                if (endpointReference.getStatus() == EndpointReference.Status.WIRED_TARGET_IN_BINDING_URI){
                    endpointReference.getTargetEndpoint().setBinding(endpointReference.getBinding());
                    endpointReference.setStatus(EndpointReference.Status.RESOLVED_BINDING);
                } else {
                    processUnknownEndpoint(endpointReference, matchAudit);
                   
                    if (!endpointReference.getStatus().equals(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED)){
                        Monitor.error(monitor,
                                      this,
                                      "endpoint-validation-messages",
                                      "NoEndpointsFound",
                                      endpointReference.toString());
                        throw new ServiceRuntimeException("Unable to bind " +
                                                          monitor.getLastProblem().toString());
                    }
                }
            } else {
                // it's build time so just give the UnknownEndpoint code a chance
                // without regard for the result
                processUnknownEndpoint(endpointReference, matchAudit);
            }
        }
       
        logger.fine(matchAudit.toString());

        if (endpointReference.getStatus() != EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED &&
            endpointReference.getStatus() != EndpointReference.Status.RESOLVED_BINDING){
           
            if (runtime){
View Full Code Here

Examples of org.jboss.test.cmp2.audit.interfaces.Audit

      {
         LoginContext login = ApplicationCallbackHandler.login("audituser2", "user2");
         try
         {
            AuditHome home = getAuditEJB();
            Audit audit = home.findByPrimaryKey(id);
            audit.setStringValue(stringValue);
         }
         finally
         {
            if (login != null)
               login.logout();
View Full Code Here

Examples of org.jboss.test.cmp2.audit.interfaces.Audit

      {
         LoginContext login = ApplicationCallbackHandler.login("old-client-login", "audituser2", "user2");
         try
         {
            AuditHome home = getAuditEJB();
            Audit audit = home.findByPrimaryKey(id);
            audit.setStringValue(stringValue);
         }
         finally
         {
            if (login != null)
               login.logout();
View Full Code Here

Examples of org.jboss.test.cmp2.audit.interfaces.Audit

      {
         LoginContext login = ApplicationCallbackHandler.login("audituser2", "user2");
         try
         {
            AuditHome home = getAuditChangedNamesEJB();
            Audit audit = home.findByPrimaryKey(id);
            audit.setStringValue(stringValue);
         }
         finally
         {
            if (login != null)
               login.logout();
View Full Code Here

Examples of org.jsf2jpa.entities.Audit

    @PreRemove
    @PreUpdate
    private void onEvent (BaseEntity o)
    {
        if (o.getAudit() == null)
            o.setAudit(new Audit());

        if (o.getAudit().getCreateDate() != null) {
            o.getAudit().setModifyDate(new Date());
        }
        else {
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.