Package org.torquebox.core.app

Examples of org.torquebox.core.app.RubyAppMetaData


        } else {

            // If data has been specified for this section, and the deployment
            // is rootless,
            // but rootlessness is not supported, then error out.
            RubyAppMetaData rubyMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
            if (data != null && !isSupportsRootless() && rubyMetaData != null && DeploymentUtils.isUnitRootless( unit )) {
                throw new DeploymentUnitProcessingException( String.format(
                        "Error processing deployment %s: The section %s requires an app root to be specified, but none has been provided.",
                        unit.getName(), getSectionName() ) );
            }
View Full Code Here


        VirtualFile root = resourceRoot.getRoot();

        if (!isRubyApplication( root )) {
            return;
        }
        RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );

        if (rubyAppMetaData == null) {
            rubyAppMetaData = new RubyAppMetaData( unit.getName() );
            try {
                rubyAppMetaData.setRoot( root.getPhysicalFile() );
            } catch (IOException e) {
                e.printStackTrace();
            }
            rubyAppMetaData.attachTo( unit );
        }
       
        unit.putAttachment( DeploymentNotifier.DEPLOYMENT_TIME_ATTACHMENT_KEY, System.currentTimeMillis() );
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void parse(DeploymentUnit unit, Object dataObj) throws Exception {
        Map<String, String> app = (Map<String, String>) dataObj;

        RubyAppMetaData appMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );

        if (appMetaData == null) {
            appMetaData = new RubyAppMetaData( unit.getName() );
            appMetaData.attachTo( unit );
        }

        if (appMetaData.getRoot() == null) {
            File root = TorqueBoxMetaData.findApplicationRootFile( app );

            if (root != null ) {
                appMetaData.setRoot( root );
            }
        }

        if (appMetaData.getEnvironmentName() == null) {
            String env = TorqueBoxMetaData.findApplicationEnvironment( app );

            if (env != null && !env.trim().equals( "" )) {
                appMetaData.setEnvironmentName( env.trim() );
            }

        }
    }
View Full Code Here

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }
        final RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
       
        if ( rubyAppMetaData == null ) {
            return;
        }
       
        String mbeanName = ObjectNameFactory.create( "torquebox.apps", new Hashtable<String, String>() {
            {
                put( "name", rubyAppMetaData.getApplicationName() );
            }
        } ).toString();
       
        ServiceName serviceName = unit.getServiceName();

        RubyApplication application = new RubyApplication();
        application.setEnvironmentName( rubyAppMetaData.getEnvironmentName() );
        application.setRootPath( rubyAppMetaData.getRoot().getAbsolutePath() );
        application.setName( rubyAppMetaData.getApplicationName() );
       
        ServiceName mbeanServiceName = serviceName.append( "mbean" );
        MBeanRegistrationService<RubyApplicationMBean> mbeanService = new MBeanRegistrationService<RubyApplicationMBean>( mbeanName, mbeanServiceName, new ImmediateValue<RubyApplicationMBean>( application ) );
        phaseContext.getServiceTarget().addService( mbeanServiceName, mbeanService )
                .addDependency( DependencyType.OPTIONAL, MBeanServerService.SERVICE_NAME, MBeanServer.class, mbeanService.getMBeanServerInjector() )
View Full Code Here

            throw new DeploymentUnitProcessingException( e );
        }

        unit.putAttachment( TorqueBoxMetaData.ATTACHMENT_KEY, metaData );

        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( unit.getName() );
        rubyAppMetaData.setRoot( rootFile );
        rubyAppMetaData.setEnvironmentName( metaData.getApplicationEnvironment() );
        rubyAppMetaData.attachTo( unit );

    }
View Full Code Here

        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );
       
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo" );
        rubyAppMetaData.attachTo( unit );
       
        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
View Full Code Here

        DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }
       
        RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
        RackMetaData rackAppMetaData = unit.getAttachment( RackMetaData.ATTACHMENT_KEY );
        RailsMetaData railsAppMetaData = unit.getAttachment( RailsMetaData.ATTACHMENT_KEY );
       
        if (rubyAppMetaData == null || rackAppMetaData == null || railsAppMetaData == null) {
            return;
        }
       
        if (!railsAppMetaData.isRails3()) {
            File root = rubyAppMetaData.getRoot();
            File rackup = rackAppMetaData.getRackUpScriptFile(root);
            if (!rackup.exists()) {
                rackAppMetaData.setRackUpScript( getRackUpScript( rackAppMetaData.getContextPath() ) );
            }
        }
View Full Code Here

       
        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setVersion( RubyRuntimeMetaData.Version.V1_9 );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );
       
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
               
        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
View Full Code Here

        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setCompileMode( RubyRuntimeMetaData.CompileMode.JIT );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
               
        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
View Full Code Here

        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setCompileMode( RubyRuntimeMetaData.CompileMode.OFF );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
               
        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
View Full Code Here

TOP

Related Classes of org.torquebox.core.app.RubyAppMetaData

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.