Author: ips
Date: 2009-05-18 13:24:15 -0400 (Mon, 18 May 2009)
New Revision: 440
Removed:
trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java
Log:
oops, I missed this on the last checkin
Deleted: trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java
===================================================================
--- trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java 2009-05-18
17:23:38 UTC (rev 439)
+++ trunk/core/src/test/java/org/jboss/on/embedded/util/BootstrapAction.java 2009-05-18
17:24:15 UTC (rev 440)
@@ -1,112 +0,0 @@
-/*
- * Embedded Jopr Project
- * Copyright (C) 2006-2009 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.jboss.on.embedded.util;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.ScopeType;
-
-import org.jboss.on.embedded.manager.history.operation.OperationHistoryManager;
-import org.jboss.on.embedded.manager.ResourceManager;
-import org.jboss.on.embedded.manager.ResourceManagerFactory;
-import org.jboss.on.embedded.bean.history.operation.OperationServerServiceImpl;
-import org.rhq.core.pc.plugin.PluginEnvironment;
-import org.rhq.core.pc.plugin.FileSystemPluginFinder;
-import org.rhq.core.pc.PluginContainerConfiguration;
-import org.rhq.core.pc.ServerServices;
-import org.rhq.core.pc.PluginContainer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.servlet.ServletException;
-import java.util.Collection;
-import java.io.File;
-
-/**
- * Seam version of BootstrapServlet
- */
-@Name("bootstrapAction")
-(a)Scope(ScopeType.APPLICATION)
-@Startup
-@Install(precedence = (Install.MOCK))
-// TODO this should be renamed TestBootstrapAction
-// TODO this should just be able to extend the regular BootstrapAction and override
-// a getPluginContainerConfiguration method to deal with getting references to the
plugins differently
-// have to check if we need to override anything else
-public class BootstrapAction
-{
- private static final Log LOG = LogFactory.getLog(BootstrapAction.class);
-
- @In(value = "historyManager", create = true)
- private OperationHistoryManager historyManager;
-
- @Create
- public void init() throws ServletException
- {
- try
- {
- bootstrap();
- }
- catch (Exception e)
- {
- LOG.error("Error bootstrapping Embedded Console", e);
- }
- }
-
- private void bootstrap()
- throws Exception
- {
- File pluginDir = new File("target/itest/plugins");
-
- PluginContainerConfiguration config = new PluginContainerConfiguration();
- config.setPluginFinder(new FileSystemPluginFinder(pluginDir));
- config.setPluginDirectory(pluginDir);
-
- ServerServices services = new ServerServices();
- OperationServerServiceImpl callbackListener = new OperationServerServiceImpl();
- callbackListener.setHistoryBean(historyManager);
-
- services.setOperationServerService(callbackListener);
- config.setServerServices(services);
-
- PluginContainer container = PluginContainer.getInstance();
- container.setConfiguration(config);
-
- LOG.info("Initializing Plugin Container");
-
- container.initialize();
-
- Collection<PluginEnvironment> plugins =
container.getPluginManager().getPlugins();
- for (PluginEnvironment pluginEnvironment : plugins)
- {
- LOG.info("Loaded Plugin: " + pluginEnvironment.getPluginName());
- }
-
- LOG.info("Discovering Services");
- ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
- resourceManager.discoverResources();
-
- LOG.info("===============================================");
- }
-}