You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/04/10 16:16:04 UTC
[42/59] [abbrv] git commit: [KARAF-2852] Merge system/core and
system/command
[KARAF-2852] Merge system/core and system/command
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/0a100d76
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/0a100d76
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/0a100d76
Branch: refs/heads/master
Commit: 0a100d76c881f6bd7e63c983f624d145180f609d
Parents: 149822e
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Thu Apr 10 08:57:14 2014 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Thu Apr 10 16:02:30 2014 +0200
----------------------------------------------------------------------
.../standard/src/main/feature/feature.xml | 1 -
system/NOTICE | 71 +++++
system/command/NOTICE | 71 -----
system/command/pom.xml | 87 -------
.../karaf/system/commands/FrameworkOptions.java | 73 ------
.../org/apache/karaf/system/commands/Name.java | 51 ----
.../apache/karaf/system/commands/Shutdown.java | 104 --------
.../karaf/system/commands/StartLevel.java | 49 ----
.../karaf/system/commands/SystemProperty.java | 157 -----------
.../apache/karaf/system/commands/Version.java | 38 ---
.../src/main/resources/OSGI-INF/bundle.info | 20 --
system/core/NOTICE | 71 -----
system/core/pom.xml | 106 --------
.../org/apache/karaf/system/FrameworkType.java | 19 --
.../org/apache/karaf/system/SystemService.java | 130 ----------
.../system/internal/SystemServiceImpl.java | 238 -----------------
.../karaf/system/internal/osgi/Activator.java | 38 ---
.../karaf/system/management/SystemMBean.java | 157 -----------
.../management/internal/SystemMBeanImpl.java | 259 -------------------
.../src/main/resources/OSGI-INF/bundle.info | 16 --
.../system/internal/SystemServiceImplTest.java | 53 ----
.../src/test/resources/etc/system.properties | 22 --
system/pom.xml | 89 ++++++-
.../org/apache/karaf/system/FrameworkType.java | 19 ++
.../org/apache/karaf/system/SystemService.java | 130 ++++++++++
.../karaf/system/commands/FrameworkOptions.java | 73 ++++++
.../org/apache/karaf/system/commands/Name.java | 51 ++++
.../apache/karaf/system/commands/Shutdown.java | 104 ++++++++
.../karaf/system/commands/StartLevel.java | 49 ++++
.../karaf/system/commands/SystemProperty.java | 157 +++++++++++
.../apache/karaf/system/commands/Version.java | 38 +++
.../system/internal/SystemServiceImpl.java | 238 +++++++++++++++++
.../karaf/system/internal/osgi/Activator.java | 38 +++
.../karaf/system/management/SystemMBean.java | 157 +++++++++++
.../management/internal/SystemMBeanImpl.java | 259 +++++++++++++++++++
system/src/main/resources/OSGI-INF/bundle.info | 16 ++
.../system/internal/SystemServiceImplTest.java | 53 ++++
system/src/test/resources/etc/system.properties | 22 ++
38 files changed, 1556 insertions(+), 1768 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/assemblies/features/standard/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml
index 90c38db..fae3b4f 100644
--- a/assemblies/features/standard/src/main/feature/feature.xml
+++ b/assemblies/features/standard/src/main/feature/feature.xml
@@ -165,7 +165,6 @@
<feature name="system" description="Provide System support" version="${project.version}">
<bundle start-level="30" start="true">mvn:org.apache.karaf.system/org.apache.karaf.system.core/${project.version}</bundle>
- <bundle start-level="30" start="true">mvn:org.apache.karaf.system/org.apache.karaf.system.command/${project.version}</bundle>
</feature>
<feature name="http" version="${project.version}" resolver="(obr)" description="Implementation of the OSGI HTTP Service">
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/NOTICE
----------------------------------------------------------------------
diff --git a/system/NOTICE b/system/NOTICE
new file mode 100644
index 0000000..b70f1f9
--- /dev/null
+++ b/system/NOTICE
@@ -0,0 +1,71 @@
+Apache Karaf
+Copyright 2010-2014 The Apache Software Foundation
+
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+OW2 (http://www.ow2.org/).
+Licensed under the BSD License.
+
+This product includes software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+Eclipse Foundation (http://www.eclipse.org/).
+Licensed under the EPL.
+
+This product includes software written by
+Antony Lesuisse.
+Licensed under Public Domain.
+
+
+II. Used Software
+
+This product uses software developed at
+FUSE Source (http://www.fusesource.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+AOP Alliance (http://aopalliance.sourceforge.net/).
+Licensed under the Public Domain.
+
+This product uses software developed at
+Tanuki Software (http://www.tanukisoftware.com/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+Jasypt (http://jasypt.sourceforge.net/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+JLine (http://jline.sourceforge.net).
+Licensed under the BSD License.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product uses software developed at
+SpringSource (http://www.springsource.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software from http://www.json.org.
+Copyright (c) 2002 JSON.org
+
+
+III. License Summary
+- Apache License 2.0
+- BSD License
+- EPL License
+- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/NOTICE
----------------------------------------------------------------------
diff --git a/system/command/NOTICE b/system/command/NOTICE
deleted file mode 100644
index b70f1f9..0000000
--- a/system/command/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/pom.xml
----------------------------------------------------------------------
diff --git a/system/command/pom.xml b/system/command/pom.xml
deleted file mode 100644
index 3eeaa19..0000000
--- a/system/command/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.karaf.system</groupId>
- <artifactId>system</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>org.apache.karaf.system.command</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Karaf :: System :: Shell Commands</name>
- <description>
- This bundle provides Karaf shell commands to manipulate system service (shutdown container, etc).
- </description>
-
- <properties>
- <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.karaf.system</groupId>
- <artifactId>org.apache.karaf.system.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.karaf.shell</groupId>
- <artifactId>org.apache.karaf.shell.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.info</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Karaf-Commands>*</Karaf-Commands>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/java/org/apache/karaf/system/commands/FrameworkOptions.java
----------------------------------------------------------------------
diff --git a/system/command/src/main/java/org/apache/karaf/system/commands/FrameworkOptions.java b/system/command/src/main/java/org/apache/karaf/system/commands/FrameworkOptions.java
deleted file mode 100644
index 9e16a7d..0000000
--- a/system/command/src/main/java/org/apache/karaf/system/commands/FrameworkOptions.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.karaf.system.commands;
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.system.FrameworkType;
-import org.apache.karaf.system.SystemService;
-
-/**
- * Command for enabling/disabling debug logging on the OSGi framework
- */
-@Command(scope = "system", name = "framework", description = "OSGi Framework options.")
-@Service
-public class FrameworkOptions implements Action {
-
- @Option(name = "-debug", aliases={"--enable-debug"}, description="Enable debug for the OSGi framework", required = false, multiValued = false)
- boolean debug;
-
- @Option(name = "-nodebug", aliases={"--disable-debug"}, description="Disable debug for the OSGi framework", required = false, multiValued = false)
- boolean nodebug;
-
- @Argument(name = "framework", required = false, description = "Name of the OSGi framework to use")
- String framework;
-
- @Reference
- SystemService systemService;
-
- @Override
- public Object execute() throws Exception {
-
- if (!debug^nodebug && framework == null) {
- System.out.printf("Current OSGi framework is %s%n", systemService.getFramework().name());
- return null;
- }
- if (framework != null) {
- FrameworkType frameworkType = FrameworkType.valueOf(framework);
- systemService.setFramework(frameworkType);
- System.out.println("Changed OSGi framework to " + frameworkType.toString().toLowerCase() + ". Karaf needs to be restarted to make the change effective");
- }
- if (debug) {
- FrameworkType frameworkType = systemService.getFramework();
- System.out.printf("Enabling debug for OSGi framework (%s)%n", frameworkType.name());
- systemService.setFrameworkDebug(true);
- }
- if (nodebug) {
- FrameworkType frameworkType = systemService.getFramework();
- System.out.printf("Disabling debug for OSGi framework (%s)%n", frameworkType.name());
- systemService.setFrameworkDebug(false);
- }
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/java/org/apache/karaf/system/commands/Name.java
----------------------------------------------------------------------
diff --git a/system/command/src/main/java/org/apache/karaf/system/commands/Name.java b/system/command/src/main/java/org/apache/karaf/system/commands/Name.java
deleted file mode 100644
index a716d82..0000000
--- a/system/command/src/main/java/org/apache/karaf/system/commands/Name.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.karaf.system.commands;
-
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.system.SystemService;
-
-/**
- * Command to shut down Karaf container.
- */
-@Command(scope = "system", name = "name", description = "Show or change Karaf instance name.")
-@Service
-public class Name implements Action {
-
- @Argument(name = "name", index = 0, description = "New name for the instance", required = false, multiValued = false)
- String name;
-
- @Reference
- SystemService systemService;
-
- @Override
- public Object execute() throws Exception {
- if (name == null) {
- System.out.println(systemService.getName());
- } else {
- systemService.setName(name);
- System.out.println("Instance name changed to " + name + ". Restart needed for this to take effect.");
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
----------------------------------------------------------------------
diff --git a/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java b/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
deleted file mode 100644
index b8b4b41..0000000
--- a/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.karaf.system.commands;
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.api.console.Session;
-import org.apache.karaf.system.SystemService;
-
-/**
- * Command to shut down Karaf container.
- */
-@Command(scope = "system", name = "shutdown", description = "Shutdown Karaf.")
-@Service
-public class Shutdown implements Action {
-
- @Option(name = "-f", aliases = "--force", description = "Force the shutdown without confirmation message.", required = false, multiValued = false)
- boolean force = false;
-
- @Option(name = "-r", aliases = "--reboot", description = "Reboot the Karaf container.", required = false, multiValued = false)
- boolean reboot = false;
-
- @Option(name = "-h", aliases = "--halt", description = "Halt the Karaf container.", required = false, multiValued = false)
- boolean halt = false;
-
- @Option(name = "-c", aliases = {"--clean", "--clean-all", "-ca"}, description = "Force a clean restart by deleting the data directory")
- private boolean cleanAll;
-
- @Option(name = "-cc", aliases = {"--clean-cache", "-cc"}, description = "Force a clean restart by deleting the cache directory")
- private boolean cleanCache;
-
-
- @Argument(name = "time", index = 0, description = "Shutdown after a specified delay. The time argument can have different" +
- " formats. First, it can be an absolute time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm" +
- " is the minute of the hour (in two digits). Second, it can be in the format +m, in which m is the number of minutes" +
- " to wait. The word now is an alias for +0.", required = false, multiValued = false)
- String time;
-
- @Reference
- SystemService systemService;
-
- @Reference
- Session session;
-
- @Override
- public Object execute() throws Exception {
-
- if (force) {
- if (reboot) {
- systemService.reboot(time, determineSwipeType());
- } else {
- systemService.halt(time);
- }
- return null;
- }
-
- for (; ; ) {
- String karafName = System.getProperty("karaf.name");
- String msg;
- if (reboot) {
- msg = String.format("Confirm: reboot instance %s (yes/no): ", karafName);
- } else {
- msg = String.format("Confirm: halt instance %s (yes/no): ", karafName);
- }
- String str = session.readLine(msg, null);
- if (str.equalsIgnoreCase("yes")) {
- if (reboot) {
- systemService.reboot(time, determineSwipeType());
- } else {
- systemService.halt(time);
- }
- }
- return null;
- }
- }
-
- private SystemService.Swipe determineSwipeType() {
- if (cleanAll) {
- return SystemService.Swipe.ALL;
- } else if (cleanCache) {
- return SystemService.Swipe.CACHE;
- }
- return SystemService.Swipe.NONE;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/java/org/apache/karaf/system/commands/StartLevel.java
----------------------------------------------------------------------
diff --git a/system/command/src/main/java/org/apache/karaf/system/commands/StartLevel.java b/system/command/src/main/java/org/apache/karaf/system/commands/StartLevel.java
deleted file mode 100644
index e91c15a..0000000
--- a/system/command/src/main/java/org/apache/karaf/system/commands/StartLevel.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.karaf.system.commands;
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.system.SystemService;
-
-/**
- * Get/set the system start level.
- */
-@Command(scope = "system", name = "start-level", description = "Gets or sets the system start level.")
-@Service
-public class StartLevel implements Action {
-
- @Argument(index = 0, name = "level", description = "The new system start level to set", required = false, multiValued = false)
- Integer level;
-
- @Reference
- SystemService systemService;
-
- @Override
- public Object execute() throws Exception {
- if (level == null) {
- System.out.println("Level " + systemService.getStartLevel());
- } else {
- systemService.setStartLevel(level);
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/java/org/apache/karaf/system/commands/SystemProperty.java
----------------------------------------------------------------------
diff --git a/system/command/src/main/java/org/apache/karaf/system/commands/SystemProperty.java b/system/command/src/main/java/org/apache/karaf/system/commands/SystemProperty.java
deleted file mode 100644
index 37c2a1e..0000000
--- a/system/command/src/main/java/org/apache/karaf/system/commands/SystemProperty.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * 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.karaf.system.commands;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Vector;
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.system.SystemService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-/**
- * Command that allow access to system properties easily.
- */
-@Command(scope = "system", name = "property", description = "Get or set a system property.")
-@Service
-public class SystemProperty implements Action {
-
- @Option(name = "-p", aliases = {"--persistent"}, description = "Persist the new value to the etc/system.properties file")
- boolean persistent;
-
- @Option(name = "-f", aliases = {"--file-dump"}, description = "Dump all system properties in a file (in data folder)")
- boolean dumpToFile;
-
- @Option(name = "-u", aliases = {"--unset"}, description = "Show unset know properties with value unset")
- boolean unset;
-
- @Argument(index = 0, name = "key", required = false, description = "The system property name")
- String key;
-
- @Argument(index = 1, name = "value", required = false, description = "New value for the system property")
- String value;
-
- @Reference
- BundleContext bundleContext;
-
- @Reference
- SystemService systemService;
-
- @Override
- public Object execute() throws Exception {
- if (key == null && value == null) {
- Properties props = (Properties) System.getProperties().clone();
-
- String def = null;
- if (unset) {
- def = "unset";
- }
-
- setProperty(props, Constants.FRAMEWORK_BEGINNING_STARTLEVEL, def);
- setProperty(props, Constants.FRAMEWORK_BOOTDELEGATION, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_APP, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_BOOT, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_EXT, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_FRAMEWORK, def);
- setProperty(props, Constants.FRAMEWORK_EXECPERMISSION, def);
- setProperty(props, Constants.FRAMEWORK_EXECUTIONENVIRONMENT, def);
- setProperty(props, Constants.FRAMEWORK_LANGUAGE, def);
- setProperty(props, Constants.FRAMEWORK_LIBRARY_EXTENSIONS, def);
- setProperty(props, Constants.FRAMEWORK_OS_NAME, def);
- setProperty(props, Constants.FRAMEWORK_OS_VERSION, def);
- setProperty(props, Constants.FRAMEWORK_PROCESSOR, def);
- setProperty(props, Constants.FRAMEWORK_SECURITY, def);
- setProperty(props, Constants.FRAMEWORK_SECURITY_OSGI, def);
- setProperty(props, Constants.FRAMEWORK_STORAGE, def);
- setProperty(props, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT, def);
- setProperty(props, Constants.FRAMEWORK_SYSTEMPACKAGES, def);
- setProperty(props, Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, def);
- setProperty(props, Constants.FRAMEWORK_VENDOR, def);
- setProperty(props, Constants.FRAMEWORK_VERSION, def);
- setProperty(props, Constants.FRAMEWORK_WINDOWSYSTEM, def);
-
- setProperty(props, Constants.SUPPORTS_BOOTCLASSPATH_EXTENSION, def);
- setProperty(props, Constants.SUPPORTS_FRAMEWORK_EXTENSION, def);
- setProperty(props, Constants.SUPPORTS_FRAMEWORK_FRAGMENT, def);
- setProperty(props, Constants.SUPPORTS_FRAMEWORK_REQUIREBUNDLE, def);
-
- if (dumpToFile) {
- PrintStream ps = new PrintStream(
- new File(
- bundleContext.getProperty("karaf.data"),
- "dump-properties-" + System.currentTimeMillis() + ".properties"
- )
- );
- ps.println("#Dump of the System and OSGi properties with the command system:property");
- ps.println("#Dump executed at " + new SimpleDateFormat().format(new Date()));
- printOrderedProperties(props, ps);
- ps.flush();
- ps.close();
- } else {
- printOrderedProperties(props, System.out);
- }
-
- return null;
- }
-
- if (value != null) {
- systemService.setSystemProperty(key, value, persistent);
- } else {
- System.out.println(System.getProperty(key));
- }
-
- return null;
- }
-
- private void printOrderedProperties(Properties props, PrintStream out) {
- Set<Object> keys = props.keySet();
- Vector<String> order = new Vector<String>(keys.size());
- for (Iterator<Object> i = keys.iterator(); i.hasNext(); ) {
- Object str = (Object) i.next();
- order.add((String) str);
- }
- Collections.sort(order);
- for (Iterator<String> i = order.iterator(); i.hasNext(); ) {
- String key = (String) i.next();
- out.println(key + "=" + props.getProperty(key));
- }
- }
-
- private void setProperty(Properties props, String key, String def) {
- String val = bundleContext.getProperty(key);
- if (val == null && def != null) {
- props.setProperty(key, def);
- } else if (val != null) {
- props.setProperty(key, val);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/java/org/apache/karaf/system/commands/Version.java
----------------------------------------------------------------------
diff --git a/system/command/src/main/java/org/apache/karaf/system/commands/Version.java b/system/command/src/main/java/org/apache/karaf/system/commands/Version.java
deleted file mode 100644
index 9837aaa..0000000
--- a/system/command/src/main/java/org/apache/karaf/system/commands/Version.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.karaf.system.commands;
-
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.system.SystemService;
-
-@Command(scope = "system", name = "version", description = "Display the instance version")
-@Service
-public class Version implements Action {
-
- @Reference
- SystemService systemService;
-
- @Override
- public Object execute() throws Exception {
- System.out.println(systemService.getVersion());
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/command/src/main/resources/OSGI-INF/bundle.info
----------------------------------------------------------------------
diff --git a/system/command/src/main/resources/OSGI-INF/bundle.info b/system/command/src/main/resources/OSGI-INF/bundle.info
deleted file mode 100644
index c115593..0000000
--- a/system/command/src/main/resources/OSGI-INF/bundle.info
+++ /dev/null
@@ -1,20 +0,0 @@
-h1. Synopsis
-
-${project.name}
-
-${project.description}
-
-Maven URL:
-[mvn:${project.groupId}/${project.artifactId}/${project.version}]
-
-h1. Description
-
-This bundle contains all Karaf system shell commands.
-
-The following commands are available:
-* system:shutdown - Shutdown the Karaf container.
-* syste:start-level - Gets or sets the Karaf system start level.
-
-h1. See also
-
-Shutdown Karaf - section of the Karaf User Guide.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/NOTICE
----------------------------------------------------------------------
diff --git a/system/core/NOTICE b/system/core/NOTICE
deleted file mode 100644
index b70f1f9..0000000
--- a/system/core/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/pom.xml
----------------------------------------------------------------------
diff --git a/system/core/pom.xml b/system/core/pom.xml
deleted file mode 100644
index 61c68e0..0000000
--- a/system/core/pom.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.karaf.system</groupId>
- <artifactId>system</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>org.apache.karaf.system.core</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Karaf :: System :: Core</name>
- <description>
- This bundle provides services to manipulate the Karaf container itself (system).
- </description>
-
- <properties>
- <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.karaf</groupId>
- <artifactId>org.apache.karaf.util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.utils</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.info</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.karaf.system,
- org.apache.karaf.system.management
- </Export-Package>
- <Private-Package>
- org.apache.karaf.system.internal,
- org.apache.karaf.system.internal.osgi,
- org.apache.karaf.system.management.internal,
- org.apache.karaf.util.tracker,
- org.apache.felix.utils.properties
- </Private-Package>
- <Bundle-Activator>
- org.apache.karaf.system.internal.osgi.Activator
- </Bundle-Activator>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/java/org/apache/karaf/system/FrameworkType.java
----------------------------------------------------------------------
diff --git a/system/core/src/main/java/org/apache/karaf/system/FrameworkType.java b/system/core/src/main/java/org/apache/karaf/system/FrameworkType.java
deleted file mode 100644
index 67720a7..0000000
--- a/system/core/src/main/java/org/apache/karaf/system/FrameworkType.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Licensed 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.karaf.system;
-
-public enum FrameworkType {
- felix,
- equinox
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/java/org/apache/karaf/system/SystemService.java
----------------------------------------------------------------------
diff --git a/system/core/src/main/java/org/apache/karaf/system/SystemService.java b/system/core/src/main/java/org/apache/karaf/system/SystemService.java
deleted file mode 100644
index 2f53946..0000000
--- a/system/core/src/main/java/org/apache/karaf/system/SystemService.java
+++ /dev/null
@@ -1,130 +0,0 @@
- /*
- * 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.karaf.system;
-
-/**
- * Describe a system service
- */
-public interface SystemService {
-
- /**
- * Types defining what to remove on a restart of Karaf
- */
- public enum Swipe {
- /** Delete nothing; simple restart */
- NONE,
- /** Delete only the cache; everything else remains */
- CACHE,
- /** Forces a clean restart by removing the working directory; this option is compatible to the former clean method. */
- ALL
- }
-
- /**
- * Halt the Karaf container.
- */
- void halt() throws Exception;
-
- /**
- * Halt the Karaf container.
- *
- * @param time shutdown delay. The time argument can have different formats.
- * First, it can be an absolute time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm
- * is the minute of the hour (in two digits). Second, it can be in the format +m, in which m is the number of minutes
- * to wait. The word now is an alias for +0.
- */
- void halt(String time) throws Exception;
-
- /**
- * Reboot the Karaf container.
- *
- * @throws Exception
- */
- void reboot() throws Exception;
-
- /**
- * Reboot the Karaf container.
- *
- * @param time reboot delay. The time argument can have different formats.
- * First, it can be an absolute time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm
- * is the minute of the hour (in two digits). Second, it can be in the format +m, in which m is the number of minutes
- * to wait. The word now is an alias for +0.
- * @param clean Force a clean restart by deleting the working directory.
- */
- void reboot(String time, Swipe clean) throws Exception;
-
- /**
- * Set the system start level.
- *
- * @param startLevel the new system start level.
- */
- void setStartLevel(int startLevel) throws Exception;
-
- /**
- * Get the system start level.
- *
- * @return the current system start level.
- */
- int getStartLevel() throws Exception;
-
- /**
- * Get the version of the current Karaf instance
- *
- * @return instance version
- */
- String getVersion();
-
- /**
- * Get the name of the current Karaf instance
- *
- * @return instance name
- */
- String getName();
-
- /**
- * Set the name of the Karaf instance
- *
- * @param name new instance name
- */
- void setName(String name);
-
- /**
- * Get the current OSGi framework in use.
- *
- * @return the name of the OSGi framework in use.
- * @throws Exception
- */
- FrameworkType getFramework();
-
- /**
- * change OSGi framework
- *
- * @param framework to use.
- */
- void setFramework(FrameworkType framework);
-
- /**
- * Enable or diable debgging
- * @param debug enable if true
- */
- void setFrameworkDebug(boolean debug);
-
- /**
- * Set a system property and persist to etc/system.properties
- * @param key
- */
- String setSystemProperty(String key, String value, boolean persist);
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/java/org/apache/karaf/system/internal/SystemServiceImpl.java
----------------------------------------------------------------------
diff --git a/system/core/src/main/java/org/apache/karaf/system/internal/SystemServiceImpl.java b/system/core/src/main/java/org/apache/karaf/system/internal/SystemServiceImpl.java
deleted file mode 100644
index 8fa5a38..0000000
--- a/system/core/src/main/java/org/apache/karaf/system/internal/SystemServiceImpl.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
-* 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.karaf.system.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import org.apache.felix.utils.properties.Properties;
-import org.apache.karaf.system.FrameworkType;
-import org.apache.karaf.system.SystemService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.startlevel.FrameworkStartLevel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Implementation of the system service.
- */
-public class SystemServiceImpl implements SystemService {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SystemServiceImpl.class);
-
- private BundleContext bundleContext;
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public BundleContext getBundleContext() {
- return this.bundleContext;
- }
-
- public void halt() throws Exception {
- halt(null);
- }
-
- public void halt(String time) throws Exception {
- shutdown(timeToSleep(time));
- }
-
- public void reboot() throws Exception {
- reboot(null, Swipe.NONE);
- }
-
- public void reboot(String time, Swipe cleanup) throws Exception {
- reboot(timeToSleep(time), cleanup);
- }
-
- private void shutdown(final long sleep) {
- new Thread() {
- public void run() {
- try {
- sleepWithMsg(sleep, "Shutdown in " + sleep / 1000 / 60 + " minute(s)");
- getBundleContext().getBundle(0).stop();
- } catch (Exception e) {
- LOGGER.error("Halt error", e);
- }
- }
- }.start();
- }
-
- private void reboot(final long sleep, final Swipe clean) {
- new Thread() {
- public void run() {
- try {
- sleepWithMsg(sleep, "Reboot in " + sleep / 1000 / 60 + " minute(s)");
- System.setProperty("karaf.restart", "true");
- if (clean.equals(Swipe.ALL)) {
- System.setProperty("karaf.clean.all", "true");
- } else if (clean.equals(Swipe.CACHE)) {
- System.setProperty("karaf.clean.cache", "true");
- }
- bundleContext.getBundle(0).stop();
- } catch (Exception e) {
- LOGGER.error("Reboot error", e);
- }
- }
- }.start();
- }
-
- private void sleepWithMsg(final long sleep, String msg)
- throws InterruptedException {
- if (sleep > 0) {
- LOGGER.info(msg);
- System.err.println(msg);
- }
- Thread.sleep(sleep);
- }
-
- public void setStartLevel(int startLevel) throws Exception {
- getBundleContext().getBundle(0).adapt(FrameworkStartLevel.class).setStartLevel(startLevel);
- }
-
- public int getStartLevel() throws Exception {
- return getBundleContext().getBundle(0).adapt(FrameworkStartLevel.class).getStartLevel();
- }
-
- /**
- * Convert a time string to sleep period (in millisecond).
- *
- * @param time the time string.
- * @return the corresponding sleep period in millisecond.
- */
- private long timeToSleep(String time) throws Exception {
- long sleep = 0;
- if (time != null) {
- if (!time.equals("now")) {
- if (time.startsWith("+")) {
- // delay in number of minutes provided
- time = time.substring(1);
- try {
- sleep = Long.parseLong(time) * 60 * 1000;
- } catch (Exception e) {
- throw new IllegalArgumentException("Time " + time + " is not valid");
- }
- } else {
- // try to parse the date in hh:mm
- String[] strings = time.split(":");
- if (strings.length != 2) {
- throw new IllegalArgumentException("Time " + time + " is not valid");
- }
- GregorianCalendar currentDate = new GregorianCalendar();
- GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE), Integer.parseInt(strings[0]), Integer.parseInt(strings[1]));
- if (shutdownDate.before(currentDate)) {
- shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
- }
- sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
- }
- }
- }
- return sleep;
- }
-
- @Override
- public String getVersion() {
- return System.getProperty("karaf.version");
- }
-
- @Override
- public String getName() {
- return bundleContext.getProperty("karaf.name");
- }
-
- @Override
- public void setName(String name) {
- try {
- String karafEtc = bundleContext.getProperty("karaf.etc");
- File etcDir = new File(karafEtc);
- File syspropsFile = new File(etcDir, "system.properties");
- FileInputStream fis = new FileInputStream(syspropsFile);
- Properties props = new Properties();
- props.load(fis);
- fis.close();
- props.setProperty("karaf.name", name);
- FileOutputStream fos = new FileOutputStream(syspropsFile);
- props.store(fos, "");
- fos.close();
- } catch (Exception e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- public FrameworkType getFramework() {
- if (bundleContext.getBundle(0).getSymbolicName().contains("felix")) {
- return FrameworkType.felix;
- } else {
- return FrameworkType.equinox;
- }
- }
-
- private Properties loadProps() throws IOException {
- return new Properties(new File(System.getProperty("karaf.etc"), "config.properties"));
- }
-
- public void setFramework(FrameworkType framework) {
- if (framework == null) {
- return;
- }
- try {
- Properties properties = loadProps();
- properties.put("karaf.framework", framework.name());
- properties.save();
- } catch (IOException e) {
- throw new RuntimeException("Error setting framework: " + e.getMessage(), e);
- }
- }
-
- public void setFrameworkDebug(boolean debug) {
- try {
- Properties properties = loadProps();
- if (debug) {
- properties.put("felix.log.level", "4");
- properties.put("osgi.debug", "etc/equinox-debug.properties");
- } else {
- properties.remove("felix.log.level");
- properties.remove("osgi.debug");
- }
- // TODO populate the equinox-debug.properties file with the one provided in shell/dev module
- properties.save();
- } catch (IOException e) {
- throw new RuntimeException("Error settting framework debugging: " + e.getMessage(), e);
- }
- }
-
- @Override
- public String setSystemProperty(String key, String value, boolean persist) {
- if (persist) {
- try {
- String etc = System.getProperty("karaf.etc");
- Properties props = new Properties(new File(etc, "system.properties"));
- props.put(key, value);
- props.save();
- } catch (IOException e) {
- throw new RuntimeException("Error persisting system property", e);
- }
- }
- return System.setProperty(key, value);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/java/org/apache/karaf/system/internal/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/system/core/src/main/java/org/apache/karaf/system/internal/osgi/Activator.java b/system/core/src/main/java/org/apache/karaf/system/internal/osgi/Activator.java
deleted file mode 100644
index b7f8eab..0000000
--- a/system/core/src/main/java/org/apache/karaf/system/internal/osgi/Activator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.karaf.system.internal.osgi;
-
-import org.apache.karaf.system.SystemService;
-import org.apache.karaf.system.internal.SystemServiceImpl;
-import org.apache.karaf.system.management.internal.SystemMBeanImpl;
-import org.apache.karaf.util.tracker.BaseActivator;
-
-public class Activator extends BaseActivator {
-
- @Override
- protected void doStart() throws Exception {
- SystemServiceImpl systemService = new SystemServiceImpl();
- systemService.setBundleContext(bundleContext);
- register(SystemService.class, systemService);
-
- SystemMBeanImpl mbean = new SystemMBeanImpl();
- mbean.setBundleContext(bundleContext);
- mbean.setSystemService(systemService);
- registerMBean(mbean, "type=system");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/java/org/apache/karaf/system/management/SystemMBean.java
----------------------------------------------------------------------
diff --git a/system/core/src/main/java/org/apache/karaf/system/management/SystemMBean.java b/system/core/src/main/java/org/apache/karaf/system/management/SystemMBean.java
deleted file mode 100644
index 5d9bdbc..0000000
--- a/system/core/src/main/java/org/apache/karaf/system/management/SystemMBean.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * 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.karaf.system.management;
-
-import javax.management.MBeanException;
-import java.util.Map;
-
-/**
- * Describe the system MBean.
- */
-public interface SystemMBean {
-
- /**
- * Stop the Karaf instance
- *
- * @throws Exception
- */
- void halt() throws MBeanException;
-
- /**
- * Stop the Karaf instance at a given time.
- *
- * @param time the time when to stop the Karaf instance.
- * @throws Exception
- */
- void halt(String time) throws MBeanException;
-
- /**
- * Reboot the Karaf instance.
- *
- * @throws Exception
- */
- void reboot() throws MBeanException;
-
- /**
- * Reboot the Karaf instance at a given time.
- *
- * @param time the time when to reboot the Karaf instance.
- * @throws Exception
- */
- void reboot(String time) throws MBeanException;
-
- /**
- * Reboot the Karaf instance at a given time and clean the cache.
- *
- * @param time the time when to reboot the Karaf instance.
- * @throws Exception
- */
- void rebootCleanCache(String time) throws MBeanException;
-
- /**
- * Reboot the Karaf instance at a given time and clean all working files.
- *
- * @param time the time when to reboot the Karaf instance.
- * @throws Exception
- */
- void rebootCleanAll(String time) throws MBeanException;
-
- /**
- * Set the system bundle start level.
- *
- * @param startLevel the new system bundle start level.
- * @throws Exception
- */
- void setStartLevel(int startLevel) throws MBeanException;
-
- /**
- * Get the current system bundle start level.
- *
- * @return the current system bundle start level.
- * @throws Exception
- */
- int getStartLevel() throws MBeanException;
-
- /**
- * Get the current OSGi framework in use.
- *
- * @return the name of the OSGi framework in use.
- * @throws Exception
- */
- String getFramework();
-
- /**
- * change OSGi framework
- *
- * @param framework to use.
- */
- void setFramework(String framework);
-
- /**
- * Enable or diable debgging
- * @param debug enable if true
- */
- void setFrameworkDebug(boolean debug);
-
- /**
- * Get the current Karaf instance name.
- *
- * @return the current Karaf instance name.
- */
- String getName();
-
- /**
- * Change Karaf instance name.
- *
- * @param name the new Karaf instance name.
- */
- void setName(String name);
-
- /**
- * Get the version of the current Karaf instance.
- *
- * @return the current Karaf instance version.
- */
- String getVersion();
-
- /**
- * Get all system properties.
- *
- * @param unset if true, display the OSGi properties even if they are not defined (with "undef" value).
- * @param dumpToFile if true, dump the properties into a file in the data folder.
- * @return the list of system properties.
- */
- Map<String, String> getProperties(boolean unset, boolean dumpToFile) throws MBeanException;
-
- /**
- * Get the value of a given system property.
- *
- * @param key the system property key.
- * @return the system property value.
- */
- String getProperty(String key);
-
- /**
- * Set the value of a system property.
- *
- * @param key the system property key.
- * @param value the new system property value.
- * @param persistent if true, persist the new value to the etc/system.properties file.
- */
- void setProperty(String key, String value, boolean persistent);
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/java/org/apache/karaf/system/management/internal/SystemMBeanImpl.java
----------------------------------------------------------------------
diff --git a/system/core/src/main/java/org/apache/karaf/system/management/internal/SystemMBeanImpl.java b/system/core/src/main/java/org/apache/karaf/system/management/internal/SystemMBeanImpl.java
deleted file mode 100644
index c0f34cd..0000000
--- a/system/core/src/main/java/org/apache/karaf/system/management/internal/SystemMBeanImpl.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * 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.karaf.system.management.internal;
-
-import org.apache.karaf.system.FrameworkType;
-import org.apache.karaf.system.SystemService;
-import org.apache.karaf.system.management.SystemMBean;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-import javax.management.MBeanException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.StandardMBean;
-import java.io.File;
-import java.io.PrintStream;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * System MBean implementation.
- */
-public class SystemMBeanImpl extends StandardMBean implements SystemMBean {
-
- private SystemService systemService;
- private BundleContext bundleContext;
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public SystemMBeanImpl() throws NotCompliantMBeanException {
- super(SystemMBean.class);
- }
-
- public void setSystemService(SystemService systemService) {
- this.systemService = systemService;
- }
-
- public SystemService getSystemService() {
- return this.systemService;
- }
-
- public void halt() throws MBeanException {
- try {
- systemService.halt();
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public void halt(String time) throws MBeanException {
- try {
- systemService.halt(time);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public void reboot() throws MBeanException {
- try {
- systemService.reboot();
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public void reboot(String time) throws MBeanException {
- try {
- systemService.reboot(time, SystemService.Swipe.NONE);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public void rebootCleanCache(String time) throws MBeanException {
- try {
- systemService.reboot(time, SystemService.Swipe.CACHE);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public void rebootCleanAll(String time) throws MBeanException {
- try {
- systemService.reboot(time, SystemService.Swipe.ALL);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public void setStartLevel(int startLevel) throws MBeanException {
- try {
- systemService.setStartLevel(startLevel);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public int getStartLevel() throws MBeanException {
- try {
- return systemService.getStartLevel();
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public String getFramework() {
- return this.systemService.getFramework().toString();
- }
-
- @Override
- public void setFramework(String framework) {
- this.systemService.setFramework(FrameworkType.valueOf(framework.toLowerCase()));
- }
-
- @Override
- public void setFrameworkDebug(boolean debug) {
- this.systemService.setFrameworkDebug(debug);
- }
-
- @Override
- public String getName() {
- return this.systemService.getName();
- }
-
- @Override
- public void setName(String name) {
- if (name == null || name.trim().isEmpty()) {
- throw new IllegalArgumentException("Instance name can't be null or empty");
- }
- this.systemService.setName(name);
- }
-
- @Override
- public String getVersion() {
- return this.systemService.getVersion();
- }
-
- @Override
- public Map<String, String> getProperties(boolean unset, boolean dumpToFile) throws MBeanException {
- try {
- Map<String, String> result = new HashMap<String, String>();
-
- Properties props = (Properties) java.lang.System.getProperties().clone();
-
- String def = null;
- if (unset) {
- def = "unset";
- }
-
- setProperty(props, Constants.FRAMEWORK_BEGINNING_STARTLEVEL, def);
- setProperty(props, Constants.FRAMEWORK_BOOTDELEGATION, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_APP, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_BOOT, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_EXT, def);
- setProperty(props, Constants.FRAMEWORK_BUNDLE_PARENT_FRAMEWORK, def);
- setProperty(props, Constants.FRAMEWORK_EXECPERMISSION, def);
- setProperty(props, Constants.FRAMEWORK_EXECUTIONENVIRONMENT, def);
- setProperty(props, Constants.FRAMEWORK_LANGUAGE, def);
- setProperty(props, Constants.FRAMEWORK_LIBRARY_EXTENSIONS, def);
- setProperty(props, Constants.FRAMEWORK_OS_NAME, def);
- setProperty(props, Constants.FRAMEWORK_OS_VERSION, def);
- setProperty(props, Constants.FRAMEWORK_PROCESSOR, def);
- setProperty(props, Constants.FRAMEWORK_SECURITY, def);
- setProperty(props, Constants.FRAMEWORK_SECURITY_OSGI, def);
- setProperty(props, Constants.FRAMEWORK_STORAGE, def);
- setProperty(props, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT, def);
- setProperty(props, Constants.FRAMEWORK_SYSTEMPACKAGES, def);
- setProperty(props, Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, def);
- setProperty(props, Constants.FRAMEWORK_VENDOR, def);
- setProperty(props, Constants.FRAMEWORK_VERSION, def);
- setProperty(props, Constants.FRAMEWORK_WINDOWSYSTEM, def);
-
- setProperty(props, Constants.SUPPORTS_BOOTCLASSPATH_EXTENSION, def);
- setProperty(props, Constants.SUPPORTS_FRAMEWORK_EXTENSION, def);
- setProperty(props, Constants.SUPPORTS_FRAMEWORK_FRAGMENT, def);
- setProperty(props, Constants.SUPPORTS_FRAMEWORK_REQUIREBUNDLE, def);
-
- if (dumpToFile) {
- PrintStream ps = new PrintStream(new File(bundleContext.getProperty("karaf.data"), "dump-properties-" + java.lang.System.currentTimeMillis() + ".properties"));
- ps.println("#Dump of the System and OSGi properties");
- ps.println("#Dump executed at " + new SimpleDateFormat().format(new Date()));
- printOrderedProperties(props, ps);
- ps.flush();
- ps.close();
- } else {
- printOrderedProperties(props, result);
- }
-
- return result;
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- private void printOrderedProperties(Properties props, PrintStream out) {
- Set<Object> keys = props.keySet();
- Vector<String> order = new Vector<String>(keys.size());
- for (Iterator<Object> i = keys.iterator(); i.hasNext(); ) {
- Object str = (Object) i.next();
- order.add((String) str);
- }
- Collections.sort(order);
- for (Iterator<String> i = order.iterator(); i.hasNext(); ) {
- String key = (String) i.next();
- out.println(key + "=" + props.getProperty(key));
- }
- }
-
- private void printOrderedProperties(Properties props, Map<String, String> result) {
- Set<Object> keys = props.keySet();
- Vector<String> order = new Vector<String>(keys.size());
- for (Iterator<Object> i = keys.iterator(); i.hasNext(); ) {
- Object str = (Object) i.next();
- order.add((String) str);
- }
- Collections.sort(order);
- for (Iterator<String> i = order.iterator(); i.hasNext(); ) {
- String key = (String) i.next();
- result.put(key, props.getProperty(key));
- }
- }
-
- private void setProperty(Properties props, String key, String def) {
- String val = bundleContext.getProperty(key);
- if (val == null && def != null) {
- props.setProperty(key, def);
- } else if (val != null) {
- props.setProperty(key, val);
- }
- }
-
- @Override
- public String getProperty(String key) {
- return java.lang.System.getProperty(key);
- }
-
- @Override
- public void setProperty(String key, String value, boolean persistent) {
- systemService.setSystemProperty(key, value, persistent);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/main/resources/OSGI-INF/bundle.info
----------------------------------------------------------------------
diff --git a/system/core/src/main/resources/OSGI-INF/bundle.info b/system/core/src/main/resources/OSGI-INF/bundle.info
deleted file mode 100644
index acca1c8..0000000
--- a/system/core/src/main/resources/OSGI-INF/bundle.info
+++ /dev/null
@@ -1,16 +0,0 @@
-h1. Synopsis
-
-${project.name}
-
-${project.description}
-
-Maven URL:
-[mvn:${project.groupId}/${project.artifactId}/${project.version}]
-
-h1. Description
-
-This bundle provides support of the system service, which control the Karaf container.
-
-h1. See also
-
-Shutdown - section of the Karaf User Guide
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/test/java/org/apache/karaf/system/internal/SystemServiceImplTest.java
----------------------------------------------------------------------
diff --git a/system/core/src/test/java/org/apache/karaf/system/internal/SystemServiceImplTest.java b/system/core/src/test/java/org/apache/karaf/system/internal/SystemServiceImplTest.java
deleted file mode 100644
index 2de4e1e..0000000
--- a/system/core/src/test/java/org/apache/karaf/system/internal/SystemServiceImplTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-* 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.karaf.system.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.apache.felix.utils.properties.Properties;
-import org.easymock.EasyMock;
-import org.junit.Assert;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-
-/**
- * Implementation of the system service.
- */
-
-public class SystemServiceImplTest {
-
- private static final String NEW_NAME = "newName";
-
- @Test
- public void testSetName() throws URISyntaxException, IOException {
- SystemServiceImpl system = new SystemServiceImpl();
- BundleContext bundleContext = EasyMock.createMock(BundleContext.class);
- URL propUrl = this.getClass().getClassLoader().getResource("etc/system.properties");
- File propfile = new File(propUrl.toURI());
- EasyMock.expect(bundleContext.getProperty("karaf.etc")).andReturn(propfile.getParentFile().getParent() + "/etc");
- EasyMock.replay(bundleContext);
- system.setBundleContext(bundleContext);
- system.setName(NEW_NAME);
- EasyMock.verify(bundleContext);
- Properties props = new Properties(propfile);
- String nameAfter = props.getProperty("karaf.name");
- Assert.assertEquals(NEW_NAME, nameAfter);
- }
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/core/src/test/resources/etc/system.properties
----------------------------------------------------------------------
diff --git a/system/core/src/test/resources/etc/system.properties b/system/core/src/test/resources/etc/system.properties
deleted file mode 100644
index 6749fbb..0000000
--- a/system/core/src/test/resources/etc/system.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-################################################################################
-#
-# 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.
-#
-################################################################################
-
-#Comment
-karaf.name=oldName
-#Comment2
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/pom.xml
----------------------------------------------------------------------
diff --git a/system/pom.xml b/system/pom.xml
index 39ce101..59d338a 100644
--- a/system/pom.xml
+++ b/system/pom.xml
@@ -29,13 +29,86 @@
</parent>
<groupId>org.apache.karaf.system</groupId>
- <artifactId>system</artifactId>
- <packaging>pom</packaging>
- <name>Apache Karaf :: System</name>
-
- <modules>
- <module>core</module>
- <module>command</module>
- </modules>
+ <artifactId>org.apache.karaf.system.core</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Karaf :: System :: Core</name>
+ <description>
+ This bundle provides services to manipulate the Karaf container itself (system).
+ </description>
+
+ <properties>
+ <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf</groupId>
+ <artifactId>org.apache.karaf.util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.utils</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.shell</groupId>
+ <artifactId>org.apache.karaf.shell.core</artifactId>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.info</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.apache.karaf.system,
+ org.apache.karaf.system.management
+ </Export-Package>
+ <Private-Package>
+ org.apache.karaf.system.commands,
+ org.apache.karaf.system.internal,
+ org.apache.karaf.system.internal.osgi,
+ org.apache.karaf.system.management.internal,
+ org.apache.karaf.util.tracker,
+ org.apache.felix.utils.properties
+ </Private-Package>
+ <Bundle-Activator>
+ org.apache.karaf.system.internal.osgi.Activator
+ </Bundle-Activator>
+ <Karaf-Commands>*</Karaf-Commands>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
http://git-wip-us.apache.org/repos/asf/karaf/blob/0a100d76/system/src/main/java/org/apache/karaf/system/FrameworkType.java
----------------------------------------------------------------------
diff --git a/system/src/main/java/org/apache/karaf/system/FrameworkType.java b/system/src/main/java/org/apache/karaf/system/FrameworkType.java
new file mode 100644
index 0000000..67720a7
--- /dev/null
+++ b/system/src/main/java/org/apache/karaf/system/FrameworkType.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed 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.karaf.system;
+
+public enum FrameworkType {
+ felix,
+ equinox
+}