.setContext( context.getContextData() );
.setContext( context.getContextData() );
/** * Start the Plexus container. * * @throws PlexusContainerException if any */ private void startPlexusContainer() throws PlexusContainerException { if ( plexus != null ) { return; } Map context = new HashMap(); context.put( "basedir", new File( "" ).getAbsolutePath() ); ContainerConfiguration containerConfiguration = new DefaultContainerConfiguration(); containerConfiguration.setName( "Doxia" ); containerConfiguration.setContext( context ); plexus = new DefaultPlexusContainer( containerConfiguration ); }
private void setupContainer() { File f = new File( "target/plexus-home" ); if ( !f.isDirectory() ) { f.mkdirs(); } Map<Object, Object> context = new HashMap<Object, Object>(); context.put( "plexus.home", f.getAbsolutePath() ); // ---------------------------------------------------------------------------- // Configuration // ---------------------------------------------------------------------------- ContainerConfiguration containerConfiguration = new DefaultContainerConfiguration() .setName( "test" ).setContext( context ); try { this.container = new DefaultPlexusContainer( containerConfiguration ); } catch ( PlexusContainerException e ) { e.printStackTrace(); fail( "Failed to create plexus container." ); } }
new DefaultContainerConfiguration().setName( "test" ).setContext( context ).setContainerConfiguration( getClass().getName().replace( '.',
containerConfiguration.setContext(context); containerConfiguration.setContainerConfiguration(plexusXml); containerConfiguration.setAutoWiring(true);
/** * This method will start the container, this is a non-blocking method, and will return once container has started * * @throws Exception */ public void startContainer() throws Exception { ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld( world ).setContainerConfiguration( configuration.getAbsolutePath() ).setContext( createContainerContext() ); container = new DefaultPlexusContainer( cc ); }
plexusXmlFile.toURI().toURL()).setContext((Map) appContext.flatten()).setAutoWiring(true) .setClassPathScanning( PlexusConstants.SCANNING_INDEX).setComponentVisibility(PlexusConstants.GLOBAL_VISIBILITY);
cc.setContext( context ); cc.setClassWorld( classWorld ); cc.setContainerConfiguration( configurationResource.getAbsolutePath() );
cc.setContext( containerContext ); cc.setContainerConfigurationURL( resolveConfig( context ) ); cc.setContext( containerContext ); cc.setContainerConfigurationURL( resolveConfig( context ) ); cc.setParentContainer( parentContainer );
private final ContainerConfiguration config() { final ContainerConfiguration config = new DefaultContainerConfiguration(); // Apply current test context config.setName( "test" ).setContext( context() ); // Find per-test components XML String path = getCustomConfigurationName(); if ( null == path ) { path = getConfigurationName( null ); } config.setContainerConfiguration( path ); // Per-test config customization customizeContainerConfiguration( config ); return config; }
public void startContainer() throws PlexusContainerException { synchronized ( waitObj ) { if ( this.container != null ) { throw new PlexusContainerException( "Container already running!" ); } AppContext context = null; try { context = createContainerContext(); } catch ( Exception e ) { throw new PlexusContainerException( "Unable to create container context!", e ); } customizeContext( context ); ContainerConfiguration configuration = new DefaultContainerConfiguration().setClassWorld( getWorld() ).setContainerConfiguration( getConfiguration().getAbsolutePath() ).setContext( context ); customizeContainerConfiguration( configuration ); container = new DefaultPlexusContainer( configuration ); customizeContainer( container ); started = true; } }
public void execute( AppDeploymentContext context ) throws AppDeploymentException { String name = "plexus.application." + context.getApplicationId(); // ---------------------------------------------------------------------------- // Create the container and start // ---------------------------------------------------------------------------- DefaultPlexusContainer applicationContainer; try { addLibJars( context, name ); // This call will initialise and start the container String config = context.getAppConfigurationFile() == null ? null : context.getAppConfigurationFile().getAbsolutePath(); ContainerConfiguration cc= new DefaultContainerConfiguration(); cc.setName( name ); cc.setContext( context.getContextValues() ); cc.setClassWorld( context .getAppRuntimeProfile().getApplicationWorld() ); cc.setContainerConfiguration( config ); cc.setParentContainer( context.getAppServerContainer() ); applicationContainer = new DefaultPlexusContainer( cc ); } catch ( PlexusContainerException e ) { throw new AppDeploymentException( "Error starting container.", e ); } context.getAppRuntimeProfile().setApplicationContainer( applicationContainer ); }