Examples of Activation


Examples of org.apache.maven.model.Activation

{
    private static final String JDK_VERSION = System.getProperty( "java.version" );

    public boolean isActive( Profile profile )
    {
        Activation activation = profile.getActivation();

        String jdk = activation.getJdk();
       
        boolean reverse = false;
       
        if ( jdk.startsWith( "!" ) )
        {
View Full Code Here

Examples of org.apache.maven.model.Activation

        return profile.getActivation() != null && profile.getActivation().getFile() != null;
    }

    public boolean isActive( Profile profile )
    {
        Activation activation = profile.getActivation();

        ActivationFile actFile = activation.getFile();

        if ( actFile != null )
        {
            // check if the file exists, if it does then the profile will be active
            String fileString = actFile.getExists();
View Full Code Here

Examples of org.apache.maven.model.Activation

        return newExecs;
    }

    private static Activation cloneProfileActivation( Activation activation )
    {
        Activation newActivation = null;
        if ( activation != null )
        {
            newActivation = new Activation();

            newActivation.setActiveByDefault( activation.isActiveByDefault() );

            ActivationFile af = activation.getFile();

            if ( af != null )
            {
                ActivationFile afNew = new ActivationFile();
                afNew.setExists( af.getExists() );
                afNew.setMissing( af.getMissing() );

                newActivation.setFile( afNew );
            }

            newActivation.setJdk( activation.getJdk() );

            ActivationProperty ap = activation.getProperty();

            if ( ap != null )
            {
                ActivationProperty newAp = new ActivationProperty();

                newAp.setName( ap.getName() );
                newAp.setValue( ap.getValue() );

                newActivation.setProperty( newAp );
            }
        }

        return newActivation;
    }
View Full Code Here

Examples of org.apache.maven.profiles.Activation

     * @return Activation
     */
    private Activation parseActivation( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Activation activation = new Activation();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "activeByDefault", null, parsed ) )
            {
                activation.setActiveByDefault( getBooleanValue( getTrimmedValue( parser.nextText() ), "activeByDefault", parser, "false" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "jdk", null, parsed ) )
            {
                activation.setJdk( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "os", null, parsed ) )
            {
                activation.setOs( parseActivationOS( "os", parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "property", null, parsed ) )
            {
                activation.setProperty( parseActivationProperty( "property", parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "file", null, parsed ) )
            {
                activation.setFile( parseActivationFile( "file", parser, strict ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

Examples of org.apache.maven.settings.Activation

     * @return Activation
     */
    private Activation parseActivation( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Activation activation = new Activation();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "activeByDefault", null, parsed ) )
            {
                activation.setActiveByDefault( getBooleanValue( getTrimmedValue( parser.nextText() ), "activeByDefault", parser, "false" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "jdk", null, parsed ) )
            {
                activation.setJdk( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "os", null, parsed ) )
            {
                activation.setOs( parseActivationOS( "os", parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "property", null, parsed ) )
            {
                activation.setProperty( parseActivationProperty( "property", parser, strict ) );
            }
            else if ( checkFieldWithDuplicate( parser, "file", null, parsed ) )
            {
                activation.setFile( parseActivationFile( "file", parser, strict ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

Examples of org.drools.core.spi.Activation

                            final InternalWorkingMemory workingMemory) {
            if ( leftTuple.getLeftTupleSink() != node ) {
                return;
            }

            final Activation activation = (Activation) leftTuple.getObject();

            // this is to catch a race condition as activations are activated and unactivated on timers
            if ( activation instanceof ScheduledAgendaItem ) {
                ScheduledAgendaItem scheduled = (ScheduledAgendaItem) activation;
                workingMemory.getTimerService().removeJob( scheduled.getJobHandle() );
                scheduled.getJobHandle().setCancel( true );
            }

            if ( activation.isQueued() ) {
                activation.remove();
                ((EventSupport) workingMemory).getAgendaEventSupport().fireActivationCancelled( activation,
                                                                                                workingMemory,
                                                                                                MatchCancelledCause.CLEAR );
            }
View Full Code Here

Examples of org.drools.runtime.rule.Activation

        AgendaGroup[] agendaGroups = session.getAgenda().getAgendaGroups();
        assertEquals(1, agendaGroups.length);
        assertEquals("MAIN", agendaGroups[0].getName());
        assertEquals(1, agendaGroups[0].getActivations().length);

        Activation activation = agendaGroups[0].getActivations()[0];
        assertEquals("ActivationCreator", activation.getRule().getName());
        Entry[] parameters = session.getActivationParameters(
            ((org.drools.spi.Activation) activation).getActivationNumber());
        assertEquals(1, parameters.length);
        assertEquals("o", parameters[0].getKey());
        assertEquals("String1", parameters[0].getValue());
View Full Code Here

Examples of org.drools.spi.Activation

        }
    }

    public void testSetResolverStraties() throws Exception {
        MockControl leftActivationControl = mocks.createControl(Activation.class);
        Activation leftActivationMock = (Activation) leftActivationControl.getMock();
        MockControl rightActivationControl = mocks.createControl(Activation.class);
        Activation rightActivationMock = (Activation) rightActivationControl.getMock();

        MockControl resolverControl_1 = mocks.createControl(ConflictResolver.class);
        final ConflictResolver resolverMock_1 = (ConflictResolver) resolverControl_1.getMock();
        MockControl resolverControl_2 = mocks.createControl(ConflictResolver.class);
        final ConflictResolver resolverMock_2 = (ConflictResolver) resolverControl_2.getMock();
View Full Code Here

Examples of org.drools.spi.Activation

            
        agenda.fireNextItem( null );

        List rules = new ArrayList();
        Iterator it = activations.iterator();
        Activation activation;
        while ( it.hasNext() )
        {
            activation = ( Activation ) it.next();
            rules.add( activation.getRule() );
        }
       
        assertContains( rule4,
                        rules );
       
View Full Code Here

Examples of org.drools.spi.Activation

                 * For each Activation remove the handle. If the Set is empty then remove the activation
                 * from justiers.
                 */
                Set activationList = (Set) this.justified.remove( ( (FactHandleImpl) handle ).getId() );
                Iterator it = activationList.iterator();
                Activation eachActivation;
                while ( it.hasNext() )
                {
                    eachActivation = (Activation) it.next();
                    Set handles = (Set) this.justifiers.get( eachActivation );
                    handles.remove( handle );
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.