felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1386621 - in /felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component: Component.java ServiceComponentPermission.java
Date Mon, 17 Sep 2012 14:12:11 GMT
Author: fmeschbe
Date: Mon Sep 17 14:12:11 2012
New Revision: 1386621

URL: http://svn.apache.org/viewvc?rev=1386621&view=rev
Log:
First shot at a permission for the admin API

Added:
    felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/ServiceComponentPermission.java
Modified:
    felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/Component.java

Modified: felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/Component.java
URL: http://svn.apache.org/viewvc/felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/Component.java?rev=1386621&r1=1386620&r2=1386621&view=diff
==============================================================================
--- felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/Component.java
(original)
+++ felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/Component.java
Mon Sep 17 14:12:11 2012
@@ -183,12 +183,18 @@ public interface Component
     /**
      * Enables this Component if it is disabled. If the Component is not
      * currently disabled this method has no effect.
+     *
+     * @throws SecurityException if the calling bundle does not have
+     *      <code>ServiceComponentPermission(component-name, CHANGE)</code>
      */
     void enable();
 
     /**
      * Disables this Component if it is enabled. If the Component is already
      * disabled this method has no effect.
+     *
+     * @throws SecurityException if the calling bundle does not have
+     *      <code>ServiceComponentPermission(component-name, CHANGE)</code>
      */
     void disable();
 

Added: felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/ServiceComponentPermission.java
URL: http://svn.apache.org/viewvc/felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/ServiceComponentPermission.java?rev=1386621&view=auto
==============================================================================
--- felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/ServiceComponentPermission.java
(added)
+++ felix/sandbox/fmeschbe/dsadmin/src/main/java/org/apache/felix/component/ServiceComponentPermission.java
Mon Sep 17 14:12:11 2012
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.component;
+
+import java.security.BasicPermission;
+
+public class ServiceComponentPermission extends BasicPermission
+{
+    /**
+     * The GET permission is required to get components and component
+     * configurations from the {@link ServiceComponentRuntime} service
+     * and to access references and properties from those components.
+     */
+    public static final String GET = "GET";
+
+    /**
+     * The CHANGE permission is required to enable or disable a component
+     */
+    public static final String CHANGE = "change";
+
+    public ServiceComponentPermission(String name, String actions)
+    {
+        super(name, actions);
+    }
+
+}



Mime
View raw message