You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2007/07/27 03:26:17 UTC

svn commit: r560051 - in /openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ container/openejb-core/src/main/java/org/apache/...

Author: dblevins
Date: Thu Jul 26 18:26:16 2007
New Revision: 560051

URL: http://svn.apache.org/viewvc?view=rev&rev=560051
Log:
OPENEJB-451: openejb.conf to properties converter

Added:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/properties
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/cmd/
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/cmd/Messages.properties
Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/FacilitiesInfo.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
    openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/FacilitiesInfo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/FacilitiesInfo.java?view=diff&rev=560051&r1=560050&r2=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/FacilitiesInfo.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/FacilitiesInfo.java Thu Jul 26 18:26:16 2007
@@ -28,4 +28,6 @@
     public TransactionServiceInfo transactionService;
     public SecurityServiceInfo securityService;
 
+    // Don't add anything here unless it's overridable using the -DserviceId.property=value convention
+    public final List<ServiceInfo> services = new ArrayList<ServiceInfo>();
 }

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java?view=auto&rev=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfo.java Thu Jul 26 18:26:16 2007
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.openejb.assembler.classic.cmd;
+
+import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
+
+import java.io.File;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ConfigurationInfo {
+
+    OpenEjbConfiguration getOpenEjbConfiguration(File tmpFile) throws UnauthorizedException;
+
+    public static class UnauthorizedException extends Exception {
+        public UnauthorizedException(String message) {
+            super(message);
+        }
+    }
+}

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java?view=auto&rev=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/ConfigurationInfoEjb.java Thu Jul 26 18:26:16 2007
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.openejb.assembler.classic.cmd;
+
+import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
+import org.apache.openejb.loader.SystemInstance;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import java.io.File;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Stateless(name = "openejb/ConfigurationInfo")
+@Remote(ConfigurationInfo.class)
+public class ConfigurationInfoEjb implements ConfigurationInfo {
+
+    public OpenEjbConfiguration getOpenEjbConfiguration(File tmpFile) throws UnauthorizedException {
+        if (tmpFile.exists()) {
+            return SystemInstance.get().getComponent(OpenEjbConfiguration.class);
+        }
+
+        throw new UnauthorizedException("Machine not authorized to see this server's configuration properties");
+    }
+
+}
+

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java?view=auto&rev=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/cmd/Info2Properties.java Thu Jul 26 18:26:16 2007
@@ -0,0 +1,288 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.openejb.assembler.classic.cmd;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
+import org.apache.openejb.assembler.classic.ServiceInfo;
+import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.util.Messages;
+import org.apache.openejb.util.OpenEjbVersion;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Date;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Info2Properties {
+    private static Messages messages = new Messages(Info2Properties.class);
+
+    private static final String defaultServerUrl = "ejbd://localhost:4201";
+
+    public static void main(String[] args) {
+
+        CommandLineParser parser = new PosixParser();
+
+        // create the Options
+        Options options = new Options();
+        options.addOption(option("v", "version", "cmd.properties.opt.version"));
+        options.addOption(option("h", "help", "cmd.properties.opt.help"));
+        options.addOption(option("s", "server-url", "url", "cmd.properties.opt.server"));
+
+        CommandLine line = null;
+        try {
+            // parse the command line arguments
+            line = parser.parse(options, args);
+        } catch (ParseException exp) {
+            help(options);
+            System.exit(-1);
+        }
+
+        if (line.hasOption("help")) {
+            help(options);
+            System.exit(0);
+        } else if (line.hasOption("version")) {
+            OpenEjbVersion.get().print(System.out);
+            System.exit(0);
+        }
+
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+
+        String serverUrl = defaultServerUrl;
+        if (line.hasOption(serverUrl)) {
+            serverUrl = line.getOptionValue("serverUrl");
+        }
+        p.put(Context.PROVIDER_URL, serverUrl);
+
+        ConfigurationInfo configInfo = null;
+        try {
+            InitialContext ctx = new InitialContext(p);
+            configInfo = (ConfigurationInfo) ctx.lookup("openejb/ConfigurationInfoBusinessRemote");
+        } catch (javax.naming.ServiceUnavailableException e) {
+            System.out.println(e.getCause().getMessage());
+            System.out.println(messages.format("cmd.deploy.serverOffline"));
+            System.exit(1);
+        } catch (javax.naming.NamingException e) {
+            System.out.println("ConfigurationInfo does not exist in server '" + serverUrl + "', check the server logs to ensure it exists and has not been removed.");
+            System.exit(2);
+        }
+
+        File tempFile = null;
+        try {
+            tempFile = File.createTempFile("configrequest", "txt");
+            if (!tempFile.exists()) {
+                throw new IllegalStateException("Failed to create tmp file: " + tempFile.getAbsolutePath());
+            }
+        } catch (Exception e) {
+            System.err.println("Temp file creation failed.");
+            e.printStackTrace();
+            System.exit(1);
+        }
+
+        OpenEjbConfiguration configuration = null;
+        try {
+            configuration = configInfo.getOpenEjbConfiguration(tempFile);
+        } catch (ConfigurationInfo.UnauthorizedException e) {
+            System.err.println("This tool is currently crippled to only work with server's on the same physical machine.  See this JIRA issue for details: http://issues.apache.org/jira/browse/OPENEJB-621");
+            System.exit(10);
+        }
+
+        comment(i18n("cmd.properties.header"));
+        comment("");
+        comment("");
+        comment("Generated by OpenEJB " + OpenEjbVersion.get().getVersion());
+        comment("On " + new Date().toString());
+        comment("");
+        comment("");
+        println("");
+        println("");
+
+        comment("-------------------------------------------------");
+        comment(" Components configurable via openejb.xml");
+        comment("-------------------------------------------------");
+        println("");
+        println("");
+
+        for (ServiceInfo info : configuration.containerSystem.containers) {
+            print(info);
+        }
+
+        for (ServiceInfo info : configuration.facilities.connectionManagers) {
+            print(info);
+        }
+
+        for (ServiceInfo info : configuration.facilities.resources) {
+            print(info);
+        }
+
+        print(configuration.facilities.securityService);
+
+        print(configuration.facilities.transactionService);
+
+        println("");
+        comment("-------------------------------------------------");
+        comment(" Services configured via conf/<id>.properties");
+        comment("-------------------------------------------------");
+        println("");
+        println("");
+
+        for (ServiceInfo info : configuration.facilities.services) {
+            print(info);
+        }
+
+        println("");
+        comment("-------------------------------------------------");
+        comment(" Misc OpenEJB flags and properties");
+        comment("-------------------------------------------------");
+        println("");
+        printSystemProperties();
+
+    }
+
+    private static void printSystemProperties() {
+
+        try {
+            Properties p = new Properties();
+            copyOpenEjbProperties(System.getProperties(), p);
+            copyOpenEjbProperties(SystemInstance.get().getProperties(), p);
+            p.store(new Filter(System.out), null);
+        } catch (IOException e) {
+            e.printStackTrace(new PrintWriter(new CommentsFilter(System.out)));
+        }
+    }
+
+    private static void copyOpenEjbProperties(Properties source, Properties dest) {
+        for (Map.Entry<Object, Object> entry : source.entrySet()) {
+            if (!(entry.getKey() instanceof String)) continue;
+            if (!(entry.getValue() instanceof String)) continue;
+
+            String key = (String) entry.getKey();
+            if (key.startsWith("openejb.")) {
+                dest.put(entry.getKey(), entry.getValue());
+            }
+        }
+    }
+
+    private static void comment(String text) {
+        text = text.replaceAll("\n", "\n# ");
+        print("# ");
+        println(text);
+    }
+
+    private static void print(String text) {
+        System.out.print(text);
+    }
+
+    private static void println(String text) {
+        System.out.println(text);
+    }
+
+    private static void print(ServiceInfo info) {
+        try {
+
+            println("");
+
+            comment(info.serviceType + "(id=" + info.id + ")");
+            comment("className: " + info.className);
+            // TODO: the codebase value usually isn't filled in, we should do that.
+            // comment("codebase: " + info.codebase);
+            comment("");
+            Properties p = new Properties();
+            for (Map.Entry<Object, Object> entry : info.properties.entrySet()) {
+                if (!(entry.getKey() instanceof String)) continue;
+                if (!(entry.getValue() instanceof String)) continue;
+
+                // If property name is 'password' replace value with 'xxxx' to protect it
+                if ("password".equalsIgnoreCase((String) entry.getKey())) {
+                    p.put(info.id + "." + entry.getKey(), "xxxx");
+                } else {
+                    p.put(info.id + "." + entry.getKey(), entry.getValue());
+                }
+            }
+            p.store(new Filter(System.out), null);
+
+        } catch (IOException e) {
+            System.out.println("# Printing service(id=" + info.id + ") failed.");
+            e.printStackTrace(new PrintWriter(new CommentsFilter(System.out)));
+        }
+
+    }
+
+    // Filter out the stupid date comment the Properties.store() method
+    // adds seemingly no matter what.
+    static class Filter extends java.io.FilterOutputStream {
+        private boolean pastFirstLine;
+
+        public Filter(OutputStream out) {
+            super(out);
+        }
+
+        public void write(int b) throws IOException {
+            if (pastFirstLine) super.write(b);
+            else pastFirstLine = b == '\n';
+        }
+
+    }
+
+    static class CommentsFilter extends java.io.FilterOutputStream {
+
+        public CommentsFilter(OutputStream out) {
+            super(out);
+        }
+
+        public void write(int b) throws IOException {
+            super.write(b);
+
+            if (b == '\n') super.write('#');
+        }
+
+    }
+
+    private static void help(Options options) {
+        HelpFormatter formatter = new HelpFormatter();
+        formatter.printHelp("properties [options]", "\n" + i18n("cmd.properties.description"), options, "\n");
+    }
+
+    private static Option option(String shortOpt, String longOpt, String description) {
+        return OptionBuilder.withLongOpt(longOpt).withDescription(i18n(description)).create(shortOpt);
+    }
+
+    private static Option option(String shortOpt, String longOpt, String argName, String description) {
+        return OptionBuilder.withLongOpt(longOpt).withArgName(argName).hasArg().withDescription(i18n(description)).create(shortOpt);
+    }
+
+    private static String i18n(String key) {
+        return messages.format(key);
+    }
+
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java?view=diff&rev=560051&r1=560050&r2=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java Thu Jul 26 18:26:16 2007
@@ -221,15 +221,6 @@
         return Thread.currentThread().getContextClassLoader().getResources(BASE_PATH);
     }
 
-
-    private static class Foo {
-        public static void main(String[] args) {
-            MainImpl main = new MainImpl();
-            main.main(args);
-        }
-    }
-
-
     private static void help() {
         help(true);
     }

Added: openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/properties?view=auto&rev=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/properties (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/properties Thu Jul 26 18:26:16 2007
@@ -0,0 +1,20 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You 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.
+#
+main.class = org.apache.openejb.assembler.classic.cmd.Info2Properties
+name = properties
+description = Convert and Print the OpenEJB configuration as properties
+
+

Added: openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/cmd/Messages.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/cmd/Messages.properties?view=auto&rev=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/cmd/Messages.properties (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/org/apache/openejb/assembler/classic/cmd/Messages.properties Thu Jul 26 18:26:16 2007
@@ -0,0 +1,12 @@
+cmd.properties.description = Connects to the server and prints out a valid properties file containing all configured properties OpenEJB can see.\n\nOptions:
+
+# options.addOption(option("v", "version", "cmd.properties.opt.version"));
+cmd.properties.opt.version = Prints the OpenEJB version and exits.
+
+# options.addOption(option("h", "help", "cmd.properties.opt.help"));
+cmd.properties.opt.help = Lists these options and exit.
+
+# options.addOption(option("s", "server-url", "url", "cmd.properties.opt.server"));
+cmd.properties.opt.server = Sets the url of the OpenEJB server to contact.  The value should be the same as the JNDI Provider URL used to lookup EJBs.  The default is 'ejbd://localhost:4201'.
+
+cmd.properties.header = OpenEJB Configuration Properties\n\nThe output of this tool takes all overrideable components OpenEJB sees\nand outputs their properties along with the current value.  This\nallows you to easily see what is running in your system, what\nproperties are available for overriding, and what exact values are for\neach component.  OpenEJB has a number of flags that can be passed to\nit not associated with any particular component, these are output as\nwell.\n\nAny component configured in OpenEJB via the openejb.xml (and some that\naren't) can be overridden using system properties.  The format is:\n\n<id>.<property-name>=<property-value>\n\nContent from this file can be safely copied as-is into the\nconf/system.properties file or sent to the users list with bug\nreports. Note, however passwords are masked. For more details on this\ntool, see http://openejb.apache.org/configuration-properties.html
\ No newline at end of file

Modified: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java?view=diff&rev=560051&r1=560050&r2=560051
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java Thu Jul 26 18:26:16 2007
@@ -57,7 +57,7 @@
 
         // Nothing may depend on the Assembler except the config code
         String dynamicAssembler = "org.apache.openejb.assembler.dynamic";
-        assertNotDependentOn("org.apache.openejb", "org.apache.openejb.assembler.classic", "org.apache.openejb.assembler", "org.apache.openejb.config", "org.apache.openejb.assembler.dynamic");
+        assertNotDependentOn("org.apache.openejb", "org.apache.openejb.assembler.classic", "org.apache.openejb.assembler", "org.apache.openejb.config", "org.apache.openejb.assembler.dynamic", "org.apache.openejb.assembler.classic.cmd");
 
         // Nothing may depend on the Dynamic Assembler
         assertNotDependentOn("org.apache.openejb", dynamicAssembler);

Modified: openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java?view=diff&rev=560051&r1=560050&r2=560051
==============================================================================
--- openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java (original)
+++ openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceManager.java Thu Jul 26 18:26:16 2007
@@ -21,6 +21,8 @@
 import org.apache.openejb.util.Logger;
 import org.apache.openejb.util.Messages;
 import org.apache.openejb.spi.ContainerSystem;
+import org.apache.openejb.assembler.classic.ServiceInfo;
+import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
 import org.apache.xbean.finder.ResourceFinder;
 
 import javax.naming.NamingException;
@@ -140,6 +142,7 @@
         Map availableServices = serviceFinder.mapAvailableServices(ServerService.class);
         List enabledServers = new ArrayList();
 
+        OpenEjbConfiguration conf = SystemInstance.get().getComponent(OpenEjbConfiguration.class);
         for (Iterator iterator = availableServices.entrySet().iterator(); iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             String serviceName = (String) entry.getKey();
@@ -147,6 +150,16 @@
 
             overrideProperties(serviceName, serviceProperties);
             serviceProperties.setProperty("name", serviceName);
+
+            if (conf != null && conf.facilities != null){
+                ServiceInfo info = new ServiceInfo();
+                info.className = ((Class) serviceProperties.get(ServerService.class)).getName();
+                info.serviceType = "ServerService";
+                info.id = serviceName;
+                info.properties = serviceProperties;
+                conf.facilities.services.add(info);
+            }
+
 
             if (isEnabled(serviceProperties)) {