http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-features/src/main/features/features.xml ---------------------------------------------------------------------- diff --git a/osgi/karaf-features/src/main/features/features.xml b/osgi/karaf-features/src/main/features/features.xml deleted file mode 100644 index 20c5ee3..0000000 --- a/osgi/karaf-features/src/main/features/features.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -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. ---> -<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="org-apache-tamaya-all"> - <features name="org-apache-tamaya-config" version="0.4-incubating"> - <features name="org-apache-tamaya-configadmin" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-osgi_alpha/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.tamaya.ext/tamaya-functions/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.tamaya.ext/tamaya-spisupport/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.tamaya.ext/tamaya-osgi-karaf_alpha/0.4-incubating/jar</bundle> - <features name="org-apache-tamaya-minimal" version="0.4-incubating"> - <feature name="org-apache-tamaya-api" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya/tamaya-api/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.geronimo.specs/geronimo-annotation_1.2_spec/1.0-alpha-1/jar</bundle> - </feature> - <feature name="org-apache-tamaya-core" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya/tamaya-core/0.4-incubating/jar</bundle> - </feature> - </features> - </features> - <features name="org-apache-tamaya-config-injection" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-osgi-injection_alpha/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.tamaya.ext/tamaya-injection-api/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.tamaya.ext/tamaya-injection-se/0.4-incubating/jar</bundle> - </features> - <feature name="org-apache-tamaya-config-updater" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-events/0.4-incubating/jar</bundle> - <bundle>mvn:org.apache.tamaya.ext/tamaya-osgi-updater_alpha/0.4-incubating/jar</bundle> - </feature> - </features> - <features name="org-apache-tamaya-formats" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-formats/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-formats-json" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-formats-json/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-formats-yaml" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-formats-yaml/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-filter" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-filter/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-resources" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-resources/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-resolver" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-resolver/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-mutable-config" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-mutable-config/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-spring" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-spring/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-optional" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-optional/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-jndi" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-jndi/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-features" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-features/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-events" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-events/0.4-incubating/jar</bundle> - </features> - <features name="org-apache-tamaya-uom" version="0.4-incubating"> - <bundle>mvn:org.apache.tamaya.ext/tamaya-uom/0.4-incubating/jar</bundle> - </features> -</features> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/bnd.bnd ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/bnd.bnd b/osgi/karaf-shell/bnd.bnd deleted file mode 100644 index 3bed7ca..0000000 --- a/osgi/karaf-shell/bnd.bnd +++ /dev/null @@ -1,38 +0,0 @@ --buildpath: \ - osgi.annotation; version=6.0.0,\ - osgi.core; version=6.0,\ - osgi.cmpn; version=6.0 - --testpath: \ - ${junit} - -javac.source: 1.8 -javac.target: 1.8 - -Bundle-Version: ${version}.${tstamp} -Bundle-Name: Apache Tamaya - Karaf Shell Commands -Bundle-SymbolicName: org.apache.tamaya.osgi.karaf.shell -Bundle-Description: Apacha Tamaya Configuration - Karaf Shell Extensions -Bundle-Category: Implementation -Bundle-Copyright: (C) Apache Foundation -Bundle-License: Apache Licence version 2 -Bundle-Vendor: Apache Software Foundation -Bundle-ContactAddress: [email protected] -Bundle-DocURL: http://tamaya.apache.org -Export-Package: \ - org.apache.tamaya.karaf.shell -Import-Package: \ - org.osgi.service.cm,\ - org.osgi.framework,\ - org.apache.tamaya,\ - org.apache.tamaya.spi,\ - org.apache.tamaya.functions,\ - org.apache.tamaya.spisupport,\ - org.apache.tamaya.osgi,\ - org.apache.tamaya.osgi.commands,\ - org.apache.felix.service.command,\ - org.apache.karaf.shell.api.console,\ - org.apache.karaf.shell.api.action,\ - org.apache.karaf.shell.api.action.lifecycle,\ - org.apache.karaf.shell.support.completers -Karaf-Commands: org.apache.tamaya.karaf.shell \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/pom.xml ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/pom.xml b/osgi/karaf-shell/pom.xml deleted file mode 100644 index 119b264..0000000 --- a/osgi/karaf-shell/pom.xml +++ /dev/null @@ -1,63 +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.tamaya.ext</groupId> - <artifactId>tamaya-osgi-all</artifactId> - <version>0.4-incubating-SNAPSHOT</version> - </parent> - - <artifactId>tamaya-osgi-karaf-shell</artifactId> - <packaging>jar</packaging> - <name>Apache Tamaya :: OSGI :: Karaf :: Shell</name> - <description>Tamaya Karaf Shell Commands</description> - - <dependencies> - <dependency> - <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-osgi</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.compendium</artifactId> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.karaf.shell</groupId> - <artifactId>org.apache.karaf.shell.core</artifactId> - <version>${dependency.karaf.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.karaf.shell</groupId> - <artifactId>org.apache.karaf.shell.console</artifactId> - <version>${dependency.karaf.version}</version> - <scope>provided</scope> - </dependency> - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/ApplyTamayaConfigCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/ApplyTamayaConfigCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/ApplyTamayaConfigCommand.java deleted file mode 100644 index d6b13c6..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/ApplyTamayaConfigCommand.java +++ /dev/null @@ -1,56 +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.tamaya.karaf.shell; - -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.Service; -import org.apache.tamaya.osgi.TamayaConfigPlugin; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_apply_config", description="Show the current Tamaya configuration.") -@Service -public class ApplyTamayaConfigCommand implements Action{ - - @Argument(index = 0, name = "pid", description = "The target OSGI component PID.", - required = true, multiValued = false) - String pid = null; - - @Option(name = "operationMode", aliases={"-m","--opmode"}, description = "Explicitly set (override) the operation mode to use.", - required = false, multiValued = false) - String opMode = null; - - @Option(name = "dryRun", aliases={"-d","--dryrun"}, description = "If set to true no OSGI configuration gets changed.", - required = false, multiValued = false) - boolean dryRun = false; - - @org.apache.karaf.shell.api.action.lifecycle.Reference - TamayaConfigService configPlugin; - - - public Object execute() throws IOException { - return(ConfigCommands.applyTamayaConfiguration(configPlugin, pid, opMode, dryRun)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupCreateCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupCreateCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupCreateCommand.java deleted file mode 100644 index dda367a..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupCreateCommand.java +++ /dev/null @@ -1,56 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.BackupCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; -import org.osgi.service.cm.ConfigurationAdmin; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_backup_create", description="Creates a backup of a current OSGI configuration.") -@Service -public class BackupCreateCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "pid", description = "The target pid to backup.", - required = true, multiValued = false) - String pid; - - @Option(name = "--force", aliases = "-f", description = "Forces to (over)write a backup, even if one already exists.", - required = false, multiValued = false) - boolean replace; - - @org.apache.karaf.shell.api.action.lifecycle.Reference - ConfigurationAdmin cm; - - @Override - public Object execute() throws IOException { - return(BackupCommands.createBackup(configPlugin, cm, pid, replace)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupDeleteCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupDeleteCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupDeleteCommand.java deleted file mode 100644 index f8fe5fe..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupDeleteCommand.java +++ /dev/null @@ -1,47 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.BackupCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_backup_delete", description="Deletes the OSGI configuration backup of Tamya.") -@Service -public class BackupDeleteCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "pid", description = "Allows to filter on the given PID. '*' removes all backups.", - required = true, multiValued = false) - String pid; - - @Override - public Object execute() throws IOException { - return(BackupCommands.deleteBackup(configPlugin, pid)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupListCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupListCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupListCommand.java deleted file mode 100644 index edc5e88..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupListCommand.java +++ /dev/null @@ -1,47 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.BackupCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_backup_list", description="List the backed-up OSGI configuration before Tamya applied changes.") -@Service -public class BackupListCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "pid", description = "Allows to filter on the given PID.", - required = false, multiValued = false) - String pid; - - @Override - public Object execute() throws IOException { - return(BackupCommands.listBackup(configPlugin, pid)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupRestoreCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupRestoreCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupRestoreCommand.java deleted file mode 100644 index e053bd2..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/BackupRestoreCommand.java +++ /dev/null @@ -1,46 +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.tamaya.karaf.shell; - -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.Service; -import org.apache.tamaya.osgi.commands.BackupCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_backup_restore", description="Restores the OSGI configuration backup of Tamya and disabled the PID for Tamaya configuration.") -@Service -public class BackupRestoreCommand implements Action{ - - @Argument(index = 0, name = "pid", description = "The target PID. '*' restores all backups.", - required = true, multiValued = false) - String pid; - - @org.apache.karaf.shell.api.action.lifecycle.Reference - TamayaConfigService configPlugin; - - @Override - public Object execute() throws IOException { - return(BackupCommands.restoreBackup(configPlugin, pid)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnableCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnableCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnableCommand.java deleted file mode 100644 index 1a7ebcf..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnableCommand.java +++ /dev/null @@ -1,67 +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.tamaya.karaf.shell; - -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.shell.api.console.CommandLine; -import org.apache.karaf.shell.api.console.Completer; -import org.apache.karaf.shell.api.console.Session; -import org.apache.karaf.shell.support.completers.StringsCompleter; -import org.apache.tamaya.osgi.Policy; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; -import java.util.List; - -@Command(scope = "tamaya", name = "tm_enable", description="Enables or disable Tamaya by default for all bundles/services (default: enabled=false)." + - " Disabling still allows to explicitly enable bundles using 'tamaya-enable' manifest or OSGI config entries.") -@Service -public class DefaultEnableCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "enabled", description = "The boolean value to enabled/disable Tamaya by default.", - required = true, multiValued = false) - boolean enabled; - - @Override - public Object execute() throws IOException { - return(ConfigCommands.setDefaultEnabled(configPlugin, enabled)); - } - - @Service - public static final class OperationModeCompleter implements Completer { - - @Override - public int complete(Session session, CommandLine commandLine, List<String> candidates) { - StringsCompleter delegate = new StringsCompleter(); - for(Policy mode: Policy.values()) { - delegate.getStrings().add(mode.toString()); - } - return delegate.complete(session, commandLine, candidates); - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnabledCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnabledCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnabledCommand.java deleted file mode 100644 index 7b29af7..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/DefaultEnabledCommand.java +++ /dev/null @@ -1,62 +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.tamaya.karaf.shell; - -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.shell.api.console.CommandLine; -import org.apache.karaf.shell.api.console.Completer; -import org.apache.karaf.shell.api.console.Session; -import org.apache.karaf.shell.support.completers.StringsCompleter; -import org.apache.tamaya.osgi.Policy; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; -import java.util.List; - -@Command(scope = "tamaya", name = "tm_enabled", description="Check if Tamaya is currently by default enabled for all bundles/services (default: enabled=false)." + - " If disabled still Tamaya allows to explicitly enable bundles using 'tamaya-enable' manifest or OSGI config entries.") -@Service -public class DefaultEnabledCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Override - public Object execute() throws IOException { - return(ConfigCommands.getDefaultEnabled(configPlugin)); - } - - @Service - public static final class OperationModeCompleter implements Completer { - - @Override - public int complete(Session session, CommandLine commandLine, List<String> candidates) { - StringsCompleter delegate = new StringsCompleter(); - for(Policy mode: Policy.values()) { - delegate.getStrings().add(mode.toString()); - } - return delegate.complete(session, commandLine, candidates); - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/GetPolicyCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/GetPolicyCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/GetPolicyCommand.java deleted file mode 100644 index 71830ca..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/GetPolicyCommand.java +++ /dev/null @@ -1,42 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_policy", description="Get the current Tamaya overriding policy.") -@Service -public class GetPolicyCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Override - public Object execute() throws IOException { - return ConfigCommands.getDefaultOpPolicy(configPlugin); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteAllCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteAllCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteAllCommand.java deleted file mode 100644 index cca7c4c..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteAllCommand.java +++ /dev/null @@ -1,43 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.HistoryCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_history_delete_all", description="Deletes the full getHistory of changes Tamaya applied to the OSGI configuration.") -@Service -public class HistoryDeleteAllCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Override - public String execute() throws IOException { - return HistoryCommands.clearHistory(configPlugin, null); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteCommand.java deleted file mode 100644 index d9df7e0..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryDeleteCommand.java +++ /dev/null @@ -1,45 +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.tamaya.karaf.shell; - -import org.apache.karaf.shell.api.action.*; -import org.apache.karaf.shell.api.action.lifecycle.Reference; -import org.apache.karaf.shell.api.action.lifecycle.Service; -import org.apache.tamaya.osgi.commands.HistoryCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_history_delete", description="Deletes the getHistory of changes Tamaya applied to the OSGI configuration.") -@Service -public class HistoryDeleteCommand implements Action{ - - @Argument(index = 0, name = "pid", description = "Allows to filter on the given PID.", - required = true, multiValued = false) - String pid; - - @Reference - private TamayaConfigService configPlugin; - - @Override - public String execute() throws IOException { - return HistoryCommands.clearHistory(configPlugin, pid); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryGetCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryGetCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryGetCommand.java deleted file mode 100644 index ec221fc..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryGetCommand.java +++ /dev/null @@ -1,69 +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.tamaya.karaf.shell; - -import org.apache.karaf.shell.api.action.*; -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.CommandLine; -import org.apache.karaf.shell.api.console.Completer; -import org.apache.karaf.shell.api.console.Session; -import org.apache.karaf.shell.support.completers.StringsCompleter; -import org.apache.tamaya.osgi.ConfigHistory; -import org.apache.tamaya.osgi.commands.HistoryCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; -import java.util.List; - -@Command(scope = "tamaya", name = "tm_history", description="Gets the getHistory of changes Tamaya applied to the OSGI configuration.") -@Service -public class HistoryGetCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "pid", description = "Allows to filter on the given PID.", - required = false, multiValued = false) - String pid; - - @Option(name = "--type", aliases = "-t", description = "Allows to filter the events types shown.", - required = false, multiValued = true) - @Completion(FilterCompleter.class) - private String[] eventTypes; - - @Override - public String execute() throws IOException { - return HistoryCommands.getHistory(configPlugin, pid, eventTypes); - } - - @Service - public static final class FilterCompleter implements Completer { - - @Override - public int complete(Session session, CommandLine commandLine, List<String> candidates) { - StringsCompleter delegate = new StringsCompleter(); - for(ConfigHistory.TaskType taskType:ConfigHistory.TaskType.values()) { - delegate.getStrings().add(taskType.toString()); - } - return delegate.complete(session, commandLine, candidates); - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeCommand.java deleted file mode 100644 index f736e4b..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeCommand.java +++ /dev/null @@ -1,41 +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.tamaya.karaf.shell; - -import org.apache.karaf.shell.api.action.*; -import org.apache.karaf.shell.api.action.lifecycle.Reference; -import org.apache.karaf.shell.api.action.lifecycle.Service; -import org.apache.tamaya.osgi.commands.HistoryCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_history_maxsize", description="Gets the maximal size of stored getHistory entries.") -@Service -public class HistoryMaxsizeCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Override - public Object execute() throws IOException { - return(HistoryCommands.getMaxHistorySize(configPlugin)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeSetCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeSetCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeSetCommand.java deleted file mode 100644 index 91f09ee..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/HistoryMaxsizeSetCommand.java +++ /dev/null @@ -1,47 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.HistoryCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_history_maxsize_set", description="Sets the maximal size of Tamaya getHistory entries.") -@Service -public class HistoryMaxsizeSetCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "size", description = "The maximum number of entries in the getHistory.", - required = true, multiValued = false) - int maxSize; - - @Override - public Object execute() throws IOException { - return(HistoryCommands.setMaxHistorySize(configPlugin, maxSize)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/InfoCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/InfoCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/InfoCommand.java deleted file mode 100644 index cb8f826..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/InfoCommand.java +++ /dev/null @@ -1,41 +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.tamaya.karaf.shell; - -import java.io.IOException; - -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.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -@Command(scope = "tamaya", name = "tm_info", description="Show he current Tamaya status.") -@Service -public class InfoCommand implements Action { - - @Reference - private TamayaConfigService configPlugin; - - public Object execute() throws IOException { - return(ConfigCommands.getInfo(configPlugin)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/OSGIConfigCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/OSGIConfigCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/OSGIConfigCommand.java deleted file mode 100644 index 128aa78..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/OSGIConfigCommand.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.tamaya.karaf.shell; - -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.Service; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_osgi_config", description="Show the current OSGI configuration.") -@Service -public class OSGIConfigCommand implements Action{ - - @Option(name = "section", aliases={"-s","--section"}, description = "A starting expression selecting the keys to be filtered.", - required = false, multiValued = false) - String section = null; - - @Argument(index = 0, name = "pid", description = "The target OSGI component PID.", - required = true, multiValued = false) - String pid = null; - - @org.apache.karaf.shell.api.action.lifecycle.Reference - TamayaConfigService configPlugin; - - - public Object execute() throws IOException { - return(ConfigCommands.readOSGIConfiguration(configPlugin, pid, section)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicyGetCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicyGetCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicyGetCommand.java deleted file mode 100644 index e38e017..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicyGetCommand.java +++ /dev/null @@ -1,42 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_policy", description="Gets the current Tamaya operation policy.") -@Service -public class PolicyGetCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Override - public Object execute() throws IOException { - return(ConfigCommands.getDefaultOpPolicy(configPlugin)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicySetCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicySetCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicySetCommand.java deleted file mode 100644 index 10e317f..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PolicySetCommand.java +++ /dev/null @@ -1,68 +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.tamaya.karaf.shell; - -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.Completion; -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.CommandLine; -import org.apache.karaf.shell.api.console.Completer; -import org.apache.karaf.shell.api.console.Session; -import org.apache.karaf.shell.support.completers.StringsCompleter; -import org.apache.tamaya.osgi.Policy; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; -import java.util.List; - -@Command(scope = "tamaya", name = "tm_policy_set", description="Sets the current Tamaya operation policy.") -@Service -public class PolicySetCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "tm_policy_set", description = "The operation policy how Tamaya intercepts OSGI configuration.", - required = true, multiValued = false) - @Completion(OperationModeCompleter.class) - String policy = null; - - @Override - public Object execute() throws IOException { - return(ConfigCommands.setDefaultOpPolicy(configPlugin, policy)); - } - - @Service - public static final class OperationModeCompleter implements Completer { - - @Override - public int complete(Session session, CommandLine commandLine, List<String> candidates) { - StringsCompleter delegate = new StringsCompleter(); - for(Policy mode: Policy.values()) { - delegate.getStrings().add(mode.toString()); - } - return delegate.complete(session, commandLine, candidates); - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesCommand.java deleted file mode 100644 index 129e9fc..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesCommand.java +++ /dev/null @@ -1,44 +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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_propagate_updates", - description="Flag if Tamaya is automatically triggering OSGI config updates, when according " + - "Tamaya configuration changes.") -@Service -public class PropagateUpdatesCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - - @Override - public Object execute() throws IOException { - return(configPlugin.isAutoUpdateEnabled()); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesSetCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesSetCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesSetCommand.java deleted file mode 100644 index ff5dc95..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropagateUpdatesSetCommand.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.tamaya.karaf.shell; - -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.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_propagate_updates_set", - description="Configure if Tamaya is automatically triggering OSGI config updates, when according " + - "Tamaya configuration changes.") -@Service -public class PropagateUpdatesSetCommand implements Action{ - - @Reference - private TamayaConfigService configPlugin; - - @Argument(index = 0, name = "enabled", description = "Set to true to enable Tamaya's updating trigger.", - required = true, multiValued = false) - boolean enabled; - - @Override - public Object execute() throws IOException { - return(ConfigCommands.setAutoUpdateEnabled(configPlugin, enabled)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertyGetCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertyGetCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertyGetCommand.java deleted file mode 100644 index 72f5b4a..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertyGetCommand.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.tamaya.karaf.shell; - -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.Service; -import org.apache.tamaya.osgi.commands.ConfigCommands; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_property", description="Get a Tamaya property.") -@Service -public class PropertyGetCommand implements Action{ - - @Argument(index = 0, name = "key", description = "The target property source id.", - required = false, multiValued = false) - String key = null; - - @Option(name="extended", aliases = "e", description = "Also print extended property value attributes.") - boolean extended; - - @Option(name = "propertysource", aliases = "ps", description = "The target property source id.", - required = false, multiValued = false) - String propertysource = null; - - public Object execute() throws IOException { - return(ConfigCommands.getProperty(propertysource, key, extended)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourceCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourceCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourceCommand.java deleted file mode 100644 index 97ff4ae..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourceCommand.java +++ /dev/null @@ -1,41 +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.tamaya.karaf.shell; - -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.Service; -import org.apache.tamaya.osgi.commands.ConfigCommands; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_propertysource", description="Show the current Tamaya entries of a propertysource.") -@Service -public class PropertySourceCommand implements Action{ - - @Argument(index = 0, name = "propertysource", description = "The target property source id.", - required = false, multiValued = false) - String propertysource = null; - - public Object execute() throws IOException { - return(ConfigCommands.getPropertySource(propertysource)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourcesCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourcesCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourcesCommand.java deleted file mode 100644 index 7aa660d..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/PropertySourcesCommand.java +++ /dev/null @@ -1,39 +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.tamaya.karaf.shell; - -import org.apache.karaf.shell.api.action.Action; -import org.apache.karaf.shell.api.action.Command; -import org.apache.karaf.shell.api.action.lifecycle.Service; -import org.apache.tamaya.Configuration; -import org.apache.tamaya.ConfigurationProvider; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.spi.PropertySource; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_propertysources", description="Get a list of currently registered propertysources.") -@Service -public class PropertySourcesCommand implements Action{ - - public Object execute() throws IOException { - return(ConfigCommands.getPropertySourceOverview()); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/TamayaConfigCommand.java ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/TamayaConfigCommand.java b/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/TamayaConfigCommand.java deleted file mode 100644 index e66d27b..0000000 --- a/osgi/karaf-shell/src/main/java/org/apache/tamaya/karaf/shell/TamayaConfigCommand.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.tamaya.karaf.shell; - -import org.apache.karaf.shell.api.action.Action; -import org.apache.karaf.shell.api.action.Command; -import org.apache.karaf.shell.api.action.Option; -import org.apache.karaf.shell.api.action.lifecycle.Service; -import org.apache.tamaya.osgi.commands.ConfigCommands; -import org.apache.tamaya.osgi.commands.TamayaConfigService; - -import java.io.IOException; - -@Command(scope = "tamaya", name = "tm_config", description="Show the current Tamaya configuration.") -@Service -public class TamayaConfigCommand implements Action{ - - @Option(name = "section", aliases={"-s","--section"}, description = "A starting expression selecting the section to be filtered.", - required = false, multiValued = false) - String section = null; - - @Option(name = "pid", aliases={"-p","--pid"}, description = "Apply filtering for the given OSGI component PID.", - required = false, multiValued = false) - String pid = null; - - @org.apache.karaf.shell.api.action.lifecycle.Reference - TamayaConfigService configPlugin; - - - public Object execute() throws IOException { - if(pid!=null){ - return(ConfigCommands.readTamayaConfig4PID(pid, section)); - } - return(ConfigCommands.readTamayaConfig(section, null)); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/karaf-shell/src/main/resources/META-INF/services/org/apache/tamaya/karaf/shell/commands ---------------------------------------------------------------------- diff --git a/osgi/karaf-shell/src/main/resources/META-INF/services/org/apache/tamaya/karaf/shell/commands b/osgi/karaf-shell/src/main/resources/META-INF/services/org/apache/tamaya/karaf/shell/commands deleted file mode 100644 index 0876782..0000000 --- a/osgi/karaf-shell/src/main/resources/META-INF/services/org/apache/tamaya/karaf/shell/commands +++ /dev/null @@ -1,44 +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 current 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. -# -org.apache.tamaya.karaf.shell.ApplyTamayaConfig -org.apache.tamaya.karaf.shell.PropagateUpdatesCommand -org.apache.tamaya.karaf.shell.PropagateUpdatesSetCommand -org.apache.tamaya.karaf.shell.BackupCreateCommand -org.apache.tamaya.karaf.shell.BackupDeleteCommand -org.apache.tamaya.karaf.shell.BackupListCommand -org.apache.tamaya.karaf.shell.BackupRestoreCommand -org.apache.tamaya.karaf.shell.DefaultEnableCommand -org.apache.tamaya.karaf.shell.DefaultEnabledCommand -org.apache.tamaya.karaf.shell.GetPolicyCommand -org.apache.tamaya.karaf.shell.HistoryDeleteAllCommand -org.apache.tamaya.karaf.shell.HistoryDeleteCommand -org.apache.tamaya.karaf.shell.HistoryGetCommand -org.apache.tamaya.karaf.shell.HistoryMaxsizeCommand -org.apache.tamaya.karaf.shell.HistoryMaxsizeSetCommand -org.apache.tamaya.karaf.shell.InfoCommand -org.apache.tamaya.karaf.shell.OSGIConfigCommand -org.apache.tamaya.karaf.shell.PolicyGetCommand -org.apache.tamaya.karaf.shell.PolicySetCommand -org.apache.tamaya.karaf.shell.PropertyGetCommand -org.apache.tamaya.karaf.shell.PropertySourceCommand -org.apache.tamaya.karaf.shell.PropertySourcesCommand -org.apache.tamaya.karaf.shell.TamayaConfigCommand - - - http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/pom.xml ---------------------------------------------------------------------- diff --git a/osgi/pom.xml b/osgi/pom.xml deleted file mode 100644 index 29b9b77..0000000 --- a/osgi/pom.xml +++ /dev/null @@ -1,109 +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.tamaya.ext</groupId> - <artifactId>tamaya-sandbox</artifactId> - <version>0.4-incubating-SNAPSHOT</version> - <relativePath/> - </parent> - - <artifactId>tamaya-osgi-all</artifactId> - <packaging>pom</packaging> - <name>Apache Tamaya :: OSGi Integration :: ALL</name> - <description>Tamaya OSGI Integration</description> - - <properties> - <osgi.config.version>1.5.0</osgi.config.version> - <osgi.tracker.version>1.5.1</osgi.tracker.version> - - <dependency.base.version>1.5.0</dependency.base.version> - <dependency.mockito.version>1.9.5</dependency.mockito.version> - <dependency.asm.version>3.0</dependency.asm.version> - <dependency.atinject.version>1.0</dependency.atinject.version> - <dependency.karaf.version>4.0.7</dependency.karaf.version> - <dependency.felix.version>5.6.1</dependency.felix.version> - <dependency.logback.version>1.0.7</dependency.logback.version> - </properties> - - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.karaf.tooling</groupId> - <artifactId>karaf-maven-plugin</artifactId> - <version>${dependency.karaf.version}</version> - <extensions>true</extensions> - </plugin> - </plugins> - </pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.18</version> - </plugin> - </plugins> - </build> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.service.cm</artifactId> - <version>${osgi.config.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.core</artifactId> - <version>${osgi.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.compendium</artifactId> - <version>${osgi.compendium.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.util.tracker</artifactId> - <version>${osgi.tracker.version}</version> - <scope>provided</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <modules> - <module>common</module> - <module>updater</module> - <module>karaf-shell</module> - <module>karaf-features</module> - <module>gogo-shell</module> - <!-- Enable if pom is properly checked in - <module>injection</module> - --> - </modules> - -</project> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/updater/bnd.bnd ---------------------------------------------------------------------- diff --git a/osgi/updater/bnd.bnd b/osgi/updater/bnd.bnd deleted file mode 100644 index 416db00..0000000 --- a/osgi/updater/bnd.bnd +++ /dev/null @@ -1,34 +0,0 @@ --buildpath: \ - osgi.annotation; version=6.0.0,\ - osgi.core; version=6.0,\ - osgi.cmpn; version=6.0 - --testpath: \ - ${junit} - -javac.source: 1.8 -javac.target: 1.8 - -Bundle-Version: ${version}.${tstamp} -Bundle-Name: Apache Tamaya - OSGI Updater -Bundle-SymbolicName: org.apache.tamaya.osgi.updater -Bundle-Description: Apacha Tamaya Configuration - OSGI Updater -Bundle-Category: Implementation -Bundle-Copyright: (C) Apache Foundation -Bundle-License: Apache Licence version 2 -Bundle-Vendor: Apache Software Foundation -Bundle-ContactAddress: [email protected] -Bundle-DocURL: http://tamaya.apache.org -Bundle-Activator: org.apache.tamaya.osgi.updater.Activator -Export-Package: \ - org.apache.tamaya.osgi.updater -Import-Package: \ - org.apache.tamaya.osgi,\ - org.osgi.framework,\ - org.osgi.service.cm,\ - org.apache.tamaya,\ - org.apache.tamaya.spi,\ - org.apache.tamaya.functions,\ - org.apache.tamaya.spisupport,\ - org.apache.tamaya.events - http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/updater/pom.xml ---------------------------------------------------------------------- diff --git a/osgi/updater/pom.xml b/osgi/updater/pom.xml deleted file mode 100644 index 18d5370..0000000 --- a/osgi/updater/pom.xml +++ /dev/null @@ -1,92 +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.tamaya.ext</groupId> - <artifactId>tamaya-osgi-all</artifactId> - <version>0.4-incubating-SNAPSHOT</version> - </parent> - - <artifactId>tamaya-osgi-updater</artifactId> - <packaging>jar</packaging> - <name>Apache Tamaya :: OSGi :: Updater</name> - <description>Tamaya Based OSGI Updater to propagate Tamaya changes to OSGI.</description> - - <dependencies> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.core</artifactId> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.compendium</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.tamaya</groupId> - <artifactId>tamaya-api</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tamaya</groupId> - <artifactId>tamaya-core</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-functions</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-spisupport</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-events</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-osgi</artifactId> - <version>${project.parent.version}</version> - </dependency> - - <!-- Testing --> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>java-hamcrest</artifactId> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - </dependency> - - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/eeab5ce0/osgi/updater/src/main/java/org/apache/tamaya/osgi/updater/Activator.java ---------------------------------------------------------------------- diff --git a/osgi/updater/src/main/java/org/apache/tamaya/osgi/updater/Activator.java b/osgi/updater/src/main/java/org/apache/tamaya/osgi/updater/Activator.java deleted file mode 100644 index a83f18f..0000000 --- a/osgi/updater/src/main/java/org/apache/tamaya/osgi/updater/Activator.java +++ /dev/null @@ -1,76 +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.tamaya.osgi.updater; - -import org.apache.tamaya.events.ConfigEventManager; -import org.apache.tamaya.events.ConfigurationChange; -import org.apache.tamaya.osgi.commands.TamayaConfigService; -import org.osgi.framework.*; -import org.osgi.service.cm.ConfigurationAdmin; - -import java.util.Timer; -import java.util.TimerTask; -import java.util.logging.Logger; - -/** - * Activator that registers the Tamaya based Service Class for {@link ConfigurationAdmin}, - * using a default service priority of {@code 0}. This behaviour is configurable based on OSGI properties: - * <ul> - * <li><p><b>org.tamaya.integration.osgi.cm.ranking, type: int</b> allows to configure the OSGI service ranking for - * Tamaya based ConfigurationAdmin instance. The default ranking used is 10.</p></li> - * <li><p><b>org.tamaya.integration.osgi.cm.override, type: boolean</b> allows to configure if Tamaya should - * register its ConfigAdmin service. Default is true.</p></li> - * </ul> - */ -public class Activator implements BundleActivator { - - private static final Logger LOG = Logger.getLogger(Activator.class.getName()); - - private EventListener listener; - - private static final long DELAY = 5000L; - private static final long PERIOD = 5000L; - private Timer updateTimer = new Timer("Tamaya OSGI update monitor.", true); - - @Override - public void start(BundleContext context) throws Exception { - listener = new EventListener(context); - ConfigEventManager.addListener(listener, ConfigurationChange.class); - LOG.info("Registered Tamaya getConfig trigger for OSGI."); - ServiceReference<TamayaConfigService> pluginRef = context.getServiceReference(TamayaConfigService.class); - TamayaConfigService tamayaPlugin = context.getService(pluginRef); - updateTimer.schedule(new TimerTask() { - @Override - public void run() { - ConfigEventManager.enableChangeMonitoring(tamayaPlugin.isAutoUpdateEnabled()); - } - }, DELAY, PERIOD); - } - - @Override - public void stop(BundleContext context) throws Exception { - updateTimer.cancel(); - if (listener != null) { - ConfigEventManager.removeListener(this.listener, ConfigurationChange.class); - LOG.info("Unregistered Tamaya getConfig trigger for OSGI."); - ConfigEventManager.enableChangeMonitoring(false); - } - } - -}
