Package org.torquebox.core.app

Examples of org.torquebox.core.app.RubyAppMetaData


    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        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;
        }
       
        RubyRuntimeMetaData runtimeMetaData = unit.getAttachmentRubyRuntimeMetaData.ATTACHMENT_KEY );
       
        if ( runtimeMetaData != null && runtimeMetaData.getRuntimeType() != null ) {
            return;
        }
       
        if (runtimeMetaData == null) {
            runtimeMetaData = new RubyRuntimeMetaData();
            unit.putAttachmentRubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );
        }
       
        runtimeMetaData.setBaseDir( rubyAppMetaData.getRoot() );
        runtimeMetaData.setEnvironment( rubyAppMetaData.getEnvironmentVariables() );
        runtimeMetaData.setRuntimeType( RubyRuntimeMetaData.RuntimeType.RAILS );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( rubyAppMetaData.getRoot() ) );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( new File( rubyAppMetaData.getRoot(), "lib" ) ) );
       
        RuntimeInitializer initializer = new RailsRuntimeInitializer( rubyAppMetaData, rackAppMetaData, railsAppMetaData );
        RuntimePreparer preparer = new BundlerAwareRuntimePreparer( rubyAppMetaData );
        runtimeMetaData.setRuntimeInitializer( initializer );
        runtimeMetaData.setRuntimePreparer( preparer );
View Full Code Here


    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }
        RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
        RackMetaData rackAppMetaData = unit.getAttachment( RackMetaData.ATTACHMENT_KEY );
       
        if ( rubyAppMetaData == null || rackAppMetaData == null ) {
            return;
        }
       
        RubyRuntimeMetaData runtimeMetaData = unit.getAttachmentRubyRuntimeMetaData.ATTACHMENT_KEY );
       
        if ( runtimeMetaData != null && runtimeMetaData.getRuntimeType() != null ) {
            return;
        }

        if (runtimeMetaData == null) {
            runtimeMetaData = new RubyRuntimeMetaData();
            unit.putAttachmentRubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );
        }

        runtimeMetaData.setBaseDir( rubyAppMetaData.getRoot() );
        runtimeMetaData.setEnvironment( rubyAppMetaData.getEnvironmentVariables() );
        runtimeMetaData.setRuntimeType( RubyRuntimeMetaData.RuntimeType.RACK );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( rubyAppMetaData.getRoot() ) );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( new File( rubyAppMetaData.getRoot(), "lib" ) ) );

        RuntimeInitializer initializer = new RackRuntimeInitializer( rubyAppMetaData, rackAppMetaData );
        RuntimePreparer preparer = new BundlerAwareRuntimePreparer( rubyAppMetaData );
        runtimeMetaData.setRuntimeInitializer( initializer );
        runtimeMetaData.setRuntimePreparer( preparer );
View Full Code Here

        DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }

        RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );

        if (rubyAppMetaData != null && runtimeMetaData != null) {
            RubyRuntimeFactory factory = new RubyRuntimeFactory( runtimeMetaData.getRuntimeInitializer(),
                    runtimeMetaData.getRuntimePreparer() );

            List<String> loadPaths = new ArrayList<String>();

            for (RubyLoadPathMetaData loadPath : runtimeMetaData.getLoadPaths()) {
                loadPaths.add( loadPath.getPath().getAbsolutePath() );
            }

            Module module = unit.getAttachment( Attachments.MODULE );

            if (module != null) {
                factory.setClassLoader( module.getClassLoader() );
            }

            factory.setServiceRegistry( phaseContext.getServiceRegistry() );
            factory.setLoadPaths( loadPaths );
            factory.setApplicationName( rubyAppMetaData.getApplicationName() );
            factory.setUseJRubyHomeEnvVar( this.useJRubyHomeEnvVar );
            factory.setApplicationEnvironment( rubyAppMetaData.getEnvironmentVariables() );
            factory.setDebug( runtimeMetaData.isDebug() );
            factory.setInteractive( runtimeMetaData.isInteractive() );
            factory.setProfileApi( runtimeMetaData.isProfileApi() );

            if (runtimeMetaData.getVersion() == RubyRuntimeMetaData.Version.V1_9) {
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;
        }
        RuntimeRestartScanner scanner = getRuntimeRestartScanner( unit );
View Full Code Here

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }
        RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );

        if (rubyAppMetaData == null) {
            return;
        }

        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );

        if (runtimeMetaData != null && runtimeMetaData.getRuntimeType() != null) {
            return;
        }

        if (runtimeMetaData == null) {
            runtimeMetaData = new RubyRuntimeMetaData();
            unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );
        }

        File root = rubyAppMetaData.getRoot();
        runtimeMetaData.setBaseDir( root );
        runtimeMetaData.setEnvironment( rubyAppMetaData.getEnvironmentVariables() );
        runtimeMetaData.setRuntimeType( RubyRuntimeMetaData.RuntimeType.BARE );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( root ) );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( new File( root, "lib" ) ) );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( new File( root, "config" ) ) );
View Full Code Here

    private void init(MockServiceRegistry serviceRegistry) throws Exception {
        this.phaseContext = createPhaseContext(serviceRegistry, "test-unit");
        this.unit = this.phaseContext.getMockDeploymentUnit();

        this.unit.putAttachment( JobSchedulerMetaData.ATTACHMENT_KEY, new JobSchedulerMetaData());
        this.unit.putAttachment( RubyAppMetaData.ATTACHMENT_KEY, new RubyAppMetaData("test-app"));
    }
View Full Code Here

        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }

        // We need the application name to name our bean with
        RubyAppMetaData appMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
        if (appMetaData != null) {
            String applicationName = appMetaData.getApplicationName();
            this.setApplicationName( applicationName );

            // Install authenticators for every domain
            List<AuthMetaData> allMetaData = unit.getAttachmentList( AuthMetaData.ATTACHMENT_KEY );
            for (AuthMetaData authMetaData : allMetaData) {
View Full Code Here

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentUtils.isUnitRootless( unit )) {
            return;
        }
        RubyAppMetaData appMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
       
        if ( appMetaData == null ) {
            return;
        }
       
View Full Code Here

            builder.setInitialMode( Mode.ACTIVE );
        }

        builder.install();

        final RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );

        String mbeanName = ObjectNameFactory.create( "torquebox.messaging.processors", new Hashtable<String, String>() {
            {
                put( "app", rubyAppMetaData.getApplicationName() );
                put( "name", StringUtils.underscore( metaData.getName() ) );
            }
        } ).toString();

        ServiceName mbeanServiceName = baseServiceName.append( "mbean" );
View Full Code Here

            }

            Map<String, Object> data = (Map<String, Object>) dataObject;

            if (data.containsKey( "default_message_encoding" )) {
                RubyAppMetaData appMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
                appMetaData.getEnvironmentVariables().put( "DEFAULT_MESSAGE_ENCODING", (String) data.get( "default_message_encoding" ) );
                data.remove( "default_message_encoding" );
            }

            for (MessageProcessorMetaData metadata : Parser.parseDestinations( data )) {
                unit.addToAttachmentList( MessageProcessorMetaData.ATTACHMENTS_KEY, metadata );
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.