RC android: load bundle classes from library
[platform/upstream/iotivity.git] / service / resource-container / android / resource-container / src / main / java / org / iotivity / service / resourcecontainer / 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 package org.iotivity.service.resourcecontainer;
21
22 import android.content.Context;
23 import java.util.List;
24
25 /**
26  * Every resource bundle has to provide a bundle activator that can be called
27  * by the resource container on bundle startup.
28  */
29 public abstract class BundleActivator {
30     protected RcsResourceContainerBundleAPI bundleAPI;
31     protected Context appContext;
32     
33     public BundleActivator(RcsResourceContainerBundleAPI bundleAPI, Context appContext){
34         this.bundleAPI = bundleAPI;
35         this.appContext = appContext;
36     }
37     /**
38      * Activates the bundle and creates all resources.
39      */
40     public abstract void activateBundle();
41
42     /**
43      * Deactivates the bundle and destroys all resources.
44      */
45     public abstract void deactivateBundle();
46
47     /**
48      * Creates a resources
49      * @param resource Instance of a BundleResource
50      */
51     public abstract void createResource(ResourceConfig resource);
52
53     /**
54      * Destroys a resource
55      * @param resource Instance of a BundleResource
56      */
57     public abstract void destroyResource(BundleResource resource);
58
59 }