X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fresource-container%2Fbundle-java-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fiotivity%2Fresourcecontainer%2Fbundle%2Fapi%2FBaseActivator.java;h=b7aab58d94865c312d540edcaafd74679f3cf5e5;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=b8e2e88dabe1d964b4a94fea3e56c1da40c96344;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/resource-container/bundle-java-api/src/main/java/org/iotivity/resourcecontainer/bundle/api/BaseActivator.java b/service/resource-container/bundle-java-api/src/main/java/org/iotivity/resourcecontainer/bundle/api/BaseActivator.java index b8e2e88..b7aab58 100644 --- a/service/resource-container/bundle-java-api/src/main/java/org/iotivity/resourcecontainer/bundle/api/BaseActivator.java +++ b/service/resource-container/bundle-java-api/src/main/java/org/iotivity/resourcecontainer/bundle/api/BaseActivator.java @@ -73,10 +73,14 @@ public class BaseActivator implements BundleActivator { * @param resource * bundle resource instance that should be made available as OIC * resource - */ - public void registerResource(BundleResource resource) { + * @return int + * 0 in case of an success + * -EEXIST when the resource already exists and was not registered + * -EINVAL when it was not possible to create such a resource + */ + public int registerResource(BundleResource resource) { bundleResources.add(resource); - registerJavaResource(resource, resource.getAttributeKeys(), bundleId, + return registerJavaResource(resource, resource.getAttributeKeys(), bundleId, resource.getURI(), resource.getResourceType(), resource.getName()); } @@ -117,8 +121,13 @@ public class BaseActivator implements BundleActivator { * unique bundle identifier * @param uri * Uri that should be used to register the resource - */ - private native void registerJavaResource(BundleResource resource, + * + * @return int + * 0 in case of an success + * -EEXIST when the resource already exists and was not registered + * -EINVAL when it was not possible to create such a resource + */ + private native int registerJavaResource(BundleResource resource, String[] attributes, String bundleId, String uri, String resourceType, String name);