You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by me...@apache.org on 2006/12/26 12:50:28 UTC
svn commit: r490283 - in
/incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server:
DirectoryHelper.java TuscanyServer.java TuscanyServerMBean.java management/
management/jmx/ management/jmx/Agent.java
Author: meerajk
Date: Tue Dec 26 03:50:27 2006
New Revision: 490283
URL: http://svn.apache.org/viewvc?view=rev&rev=490283
Log:
Intermediate checkin.
Added:
incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java (with props)
incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/
incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/
incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java (with props)
Modified:
incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/DirectoryHelper.java
incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServer.java
Modified: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/DirectoryHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/DirectoryHelper.java?view=diff&rev=490283&r1=490282&r2=490283
==============================================================================
--- incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/DirectoryHelper.java (original)
+++ incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/DirectoryHelper.java Tue Dec 26 03:50:27 2006
@@ -25,7 +25,7 @@
/**
* Utility class for directory related operations.
*
- * @author $Revision$ $Date$
+ * @version $Revision$ $Date$
*
*/
public abstract class DirectoryHelper {
@@ -33,6 +33,9 @@
/** Installation directory system property. */
private static final String INSTALL_DIRECTORY_PROPERTY = "tuscany.installDir";
+ /** Boot directory system property. */
+ private static final String BOOT_DIRECTORY_PROPERTY = "tuscany.bootDir";
+
/** Boot path. */
private static final String BOOT_PATH = "boot";
@@ -89,12 +92,20 @@
*/
static final File getBootDirectory(File installDirectory) {
- File bootDirectory = new File(installDirectory, BOOT_PATH);
+ File bootDirectory = null;
+
+ String bootDirectoryPath = System.getProperty(BOOT_DIRECTORY_PROPERTY);
+ if (bootDirectoryPath != null) {
+ bootDirectory = new File(bootDirectoryPath);
+ } else {
+ bootDirectory = new File(installDirectory, BOOT_PATH);
+ }
if(!bootDirectory.exists()) {
throw new IllegalStateException("Boot directory doesn't exist: " + bootDirectory);
}
return bootDirectory;
+
}
}
Modified: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServer.java?view=diff&rev=490283&r1=490282&r2=490283
==============================================================================
--- incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServer.java (original)
+++ incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServer.java Tue Dec 26 03:50:27 2006
@@ -20,6 +20,10 @@
import java.io.File;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
/**
* This class provides the commandline interface for starting the
* tuscany standalone server.
@@ -48,7 +52,7 @@
* @version $Rev$ $Date$
*
*/
-public class TuscanyServer {
+public class TuscanyServer implements TuscanyServerMBean {
/** Administration port system property. */
private static final String ADMIN_PORT_PROPERTY = "tuscany.adminPort";
@@ -71,10 +75,14 @@
*
* @param args Commandline arguments.
*/
- public static void main(String[] args) {
+ public static void main(String[] args) throws Exception {
TuscanyServer tuscanyServer = TuscanyServer.newInstance();
tuscanyServer.start();
+
+ MBeanServer mBeanServer = MBeanServerFactory.createMBeanServer("tuscany");
+ mBeanServer.registerMBean(tuscanyServer, new ObjectName("tuscany:name=LoginStats"));
+
}
/**
@@ -89,8 +97,16 @@
* Starts the server.
*
*/
- private void start() {
+ public void start() {
System.err.println("Started");
+ }
+
+ /**
+ * Starts the server.
+ *
+ */
+ public void shutdown() {
+ System.err.println("shutdown");
}
}
Added: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java?view=auto&rev=490283
==============================================================================
--- incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java (added)
+++ incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java Tue Dec 26 03:50:27 2006
@@ -0,0 +1,41 @@
+/*
+ * 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.tuscany.standalone.server;
+
+/**
+ * Management interface for the tuscany server.
+ *
+ * @version $Revision$ $Date$
+ *
+ */
+public interface TuscanyServerMBean {
+
+ /**
+ * Starts the server.
+ *
+ */
+ public void start();
+
+ /**
+ * Starts the server.
+ *
+ */
+ public void shutdown();
+
+}
Propchange: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/TuscanyServerMBean.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java?view=auto&rev=490283
==============================================================================
--- incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java (added)
+++ incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java Tue Dec 26 03:50:27 2006
@@ -0,0 +1,29 @@
+/*
+ * 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.tuscany.standalone.server.management.jmx;
+
+/**
+ * Utility for starting the JMX server.
+ *
+ * @version $Revsion$ $Date$
+ *
+ */
+public class Agent {
+
+}
Propchange: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/runtime/standalone/server.start/src/main/java/org/apache/tuscany/standalone/server/management/jmx/Agent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org