Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / service / resource-container / bundle-java-api / src / main / java / org / iotivity / resourcecontainer / bundle / api / BundleActivator.java
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 package org.iotivity.resourcecontainer.bundle.api;
22
23 import java.util.List;
24
25 /**
26  * The BundleActivator interface needs to be implemented. A bundle provider
27  * can directly extend fromt the BaseActivator.
28  */
29 public interface BundleActivator {
30     /**
31      * Activates the bundle and creates all resources.
32      */
33     public void activateBundle();
34
35     /**
36      * Deactivates the bundle and destroys all resources.
37      */
38     public void deactivateBundle();
39
40     /**
41      * Registers a single resource instance at the resource container
42      * @param resource Instance of a BundleResource
43      */
44     public void registerResource(BundleResource resource);
45
46     /**
47      * Unregisters a single resource instance at the resource container
48      * @param resource Instance of a BundleResource
49      */
50     public void unregisterResource(BundleResource resource);
51
52     /**
53      * List the configuration of the bundle resources.
54      * @return List of configuration for each resource 
55      */
56     public List<ResourceConfig> getConfiguredBundleResources();
57 }