/*  Copyright 2009 Tonny Kohar.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.qi4j.library.swing.envisage.school;

import org.qi4j.bootstrap.Energy4Java;
import org.qi4j.library.swing.envisage.Envisage;
import org.qi4j.spi.structure.ApplicationSPI;
import org.qi4j.spi.structure.ApplicationModelSPI;
import java.rmi.MarshalledObject;

/**
 * @author Tonny Kohar (tonny.kohar@gmail.com)
 */
public class EnvisageSchoolSample
{
    public static void main( String[] args ) throws Exception
    {
        EnvisageSchoolSample sample = new EnvisageSchoolSample();
        sample.runSample();
    }

    private void runSample() throws Exception
    {
        Energy4Java energy4Java = new Energy4Java(); 

        ApplicationModelSPI application = energy4Java.newApplicationModel( new SchoolAssembler());

        application = (ApplicationModelSPI) new MarshalledObject(application).get();

        new Envisage().run( application );
    }
}

@@ -1314,94 +1314,8 @@
 );%0A%0A
-        application = (ApplicationModelSPI) new MarshalledObject(application).get();%0A%0A
     

Refactored application model so that app instantiation has three phases: 1: ApplicationAssembler -> ApplicationModelSPI 2: ApplicationModelSPI -> ApplicationInstance 3: ApplicationInstance.activate()