Package org.kie.aries.blueprint.factorybeans

Examples of org.kie.aries.blueprint.factorybeans.KSessionOptions


        collectionMetadata = KieSessionBatchElementParser.parseBatchElement(this, context, element);
        beanMetadata.addArgument(collectionMetadata, null, 4);

        beanMetadata.setActivation(ComponentMetadata.ACTIVATION_LAZY);

        KSessionOptions kSessionOptions = new KSessionOptions();

        if ( ELEMENT_NAME_KSESSION.equalsIgnoreCase(localName)) {
            kSessionOptions.setkBaseRef(kbaseRef);
            kSessionOptions.setType(type);
            beanMetadata.setFactoryMethod("createKieSession");
        } else {
            beanMetadata.setFactoryMethod("createKieSessionRef");
        }

        kSessionOptions.setDef(element.getAttribute(ATTRIBUTE_DEFAULT));
        kSessionOptions.setClockType(element.getAttribute(ATTRIBUTE_SCOPE));
        kSessionOptions.setScope(element.getAttribute(ATTRIBUTE_CLOCK_TYPE));

        beanMetadata.setActivation(ComponentMetadata.ACTIVATION_LAZY);
        MutablePassThroughMetadata passThroughMetadata = context.createMetadata(MutablePassThroughMetadata.class);
        passThroughMetadata.setObject(kSessionOptions);
        beanMetadata.addArgument(passThroughMetadata, null, 5);
View Full Code Here


                        BeanArgument beanArgument = metadata.getArguments().get(0);
                        String ksessionName = ((MutableValueMetadata)beanArgument.getValue()).getStringValue();

                        BeanArgument kbOptionsArg = metadata.getArguments().get(5);
                        PassThroughMetadata passThroughMetadata = (PassThroughMetadata) kbOptionsArg.getValue();
                        KSessionOptions kSessionOptions = (KSessionOptions) passThroughMetadata.getObject();
                        String type = kSessionOptions.getType();
                        String kbaseRef = kSessionOptions.getkBaseRef();

                        if( kbaseRef.equalsIgnoreCase(kieBaseModel.getName())) {
                            KieSessionModelImpl kSession = new KieSessionModelImpl(kieBaseModel, ksessionName);
                            kSession.setType(type != null ? KieSessionModel.KieSessionType.valueOf(type.toUpperCase()) : KieSessionModel.KieSessionType.STATEFUL);

                            kSession.setDefault( "true".equals( kSessionOptions.getDef() ) );
                            String clockType = kSessionOptions.getClockType();
                            if ( clockType != null && !clockType.isEmpty() ) {
                                kSession.setClockType( ClockTypeOption.get(clockType) );
                            }
                            String scope = kSessionOptions.getScope();
                            if ( scope !=null && !scope.isEmpty() ) {
                                kSession.setScope( scope.trim() );
                            }
                            Map<String, KieSessionModel> rawKieSessionModels = kieBaseModel.getRawKieSessionModels();
                            rawKieSessionModels.put(kSession.getName(), kSession);
View Full Code Here

TOP

Related Classes of org.kie.aries.blueprint.factorybeans.KSessionOptions

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.