<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="libs/Simulator.jar"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="libs/Simulator.jar"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>ClientControllerPlugin</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
+ <name>ClientControllerPlugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
</projectDescription>
}
public static Image getImage(String imagePath) {
- Image img = null;
if (null == imagePath || imagePath.length() < 1) {
- return img;
+ return null;
}
URL imageURL = Activator.getDefault().getBundle().getEntry(imagePath);
ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL);
/**
* This class acts as an interface between the simulator java SDK and the
* various UI modules. It maintains all the details of resources and provides
- * other UI modules with the information required. It also handles responses for find,
- * GET, PUT, POST, Observe and automatic verification operations from native layer and propagates
- * those events to the registered UI listeners.
+ * other UI modules with the information required. It also handles responses for
+ * find, GET, PUT, POST, Observe and automatic verification operations from
+ * native layer and propagates those events to the registered UI listeners.
*/
public class ResourceManager {
Map<String, RemoteResourceAttribute> attributeMap = fetchResourceAttributesFromModel(resourceModelN);
// TODO: For debugging
- RemoteResourceAttribute.printAttributes(attributeMap);
- System.out.println("Attributes found: " + (null != attributeMap));
- System.out.println("No of attributes: " + attributeMap.size());
+ if (null != attributeMap) {
+ RemoteResourceAttribute.printAttributes(attributeMap);
+ System.out.println("Attributes found: " + (null != attributeMap));
+ System.out.println("No of attributes: " + attributeMap.size());
- resource.setResourceAttributesMap(attributeMap);
+ resource.setResourceAttributesMap(attributeMap);
+ }
return resource;
}
Map<String, RemoteResourceAttribute> resourceAttributeMap = null;
if (null != resourceModelN) {
Map<String, ResourceAttribute> attributeMapN;
- attributeMapN = resourceModelN.getAttributes();
+ try {
+ attributeMapN = resourceModelN.getAttributes();
+ } catch (SimulatorException e) {
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(),
+ new Date(),
+ "[" + e.getClass().getSimpleName() + "]"
+ + e.code().toString() + "-"
+ + e.message());
+ return null;
+ }
if (null != attributeMapN) {
resourceAttributeMap = new HashMap<String, RemoteResourceAttribute>();
model = itr.next();
attName = model.getAttName();
attribute = attMap.get(attName);
+ if (null == attribute) {
+ continue;
+ }
attType = attribute.getAttValBaseType();
if (attType == Type.INT) {
int attValue;
try {
attValue = Integer.parseInt(model.getAttValue());
+ resourceModel.addAttributeInt(attName, attValue);
} catch (NumberFormatException e) {
- attValue = -1;
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(), new Date(),
+ e.getMessage());
+ } catch (SimulatorException e) {
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(),
+ new Date(),
+ "[" + e.getClass().getSimpleName() + "]"
+ + e.code().toString() + "-"
+ + e.message());
}
- resourceModel.addAttribute(attName, attValue);
} else if (attType == Type.DOUBLE) {
double attValue;
try {
attValue = Double.parseDouble(model.getAttValue());
+ resourceModel.addAttributeDouble(attName, attValue);
} catch (NumberFormatException e) {
- attValue = -1.0;
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(), new Date(),
+ e.getMessage());
+ } catch (SimulatorException e) {
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(),
+ new Date(),
+ "[" + e.getClass().getSimpleName() + "]"
+ + e.code().toString() + "-"
+ + e.message());
}
- resourceModel.addAttribute(attName, attValue);
} else if (attType == Type.BOOL) {
boolean attValue;
attValue = Boolean.parseBoolean(model.getAttValue());
- resourceModel.addAttribute(attName, attValue);
+ try {
+ resourceModel.addAttributeBoolean(attName, attValue);
+ } catch (SimulatorException e) {
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(),
+ new Date(),
+ "[" + e.getClass().getSimpleName() + "]"
+ + e.code().toString() + "-"
+ + e.message());
+ }
} else if (attType == Type.STRING) {
String attValue;
attValue = model.getAttValue();
- resourceModel.addAttribute(attName, attValue);
+ try {
+ resourceModel.addAttributeString(attName, attValue);
+ } catch (SimulatorException e) {
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(),
+ new Date(),
+ "[" + e.getClass().getSimpleName() + "]"
+ + e.code().toString() + "-"
+ + e.message());
+ }
}
}
return resourceModel;
}
VerificationDialog ad = new VerificationDialog(Display
.getDefault().getActiveShell(), autoStatus);
- if (ad.open() == Window.OK) {
-
- }
+ ad.open();
}
});
}
+ e.getMessage());
} finally {
try {
- out.close();
+ if (null != out) {
+ out.close();
+ }
} catch (IOException e) {
- // Error occurred during close. Ignoring
+ System.out.println("Error occurred during close.");
}
}
}
Set<String> searchTypes = findWizard
.getSearchTypes();
- System.out.println(searchTypes);
- // Call native method to clear existing resources of
- // the given search types.
- resourceManager.deleteResources(searchTypes);
+ if (null != searchTypes) {
+ System.out.println(searchTypes);
+ // Call native method to clear existing
+ // resources of
+ // the given search types.
+ resourceManager.deleteResources(searchTypes);
+
+ // Update the tree
+ treeViewer.refresh();
+ favTreeViewer.refresh();
+
+ // Call native method to find Resources
+ boolean result = resourceManager
+ .findResourceRequest(searchTypes);
+ if (result) {
+ searchUIOperation(false);
+ } else {
+ MessageDialog
+ .openError(Display.getDefault()
+ .getActiveShell(),
+ "Find Resource status",
+ "Operation failed due to some problems in core layer.");
+ }
- // Update the tree
- treeViewer.refresh();
- favTreeViewer.refresh();
+ // Store this information for refresh
+ // functionality
+ resourceManager
+ .setLastKnownSearchTypes(searchTypes);
- // Call native method to find Resources
- boolean result = resourceManager
- .findResourceRequest(searchTypes);
- if (result) {
- searchUIOperation(false);
- } else {
- MessageDialog
- .openError(Display.getDefault()
- .getActiveShell(),
- "Find Resource status",
- "Operation failed due to some problems in core layer.");
+ // Change the refresh visibility
+ refreshButton.setEnabled(true);
}
-
- // Store this information for refresh functionality
- resourceManager
- .setLastKnownSearchTypes(searchTypes);
-
- // Change the refresh visibility
- refreshButton.setEnabled(true);
}
}
});
*/
// TODO: Temporarily adding a resourceType for testing
- resourceTypeCmb.add("oic.r.light");
+ // resourceTypeCmb.add("oic.r.light");
+ resourceTypeCmb.add("sample.light");
// By default, selecting the first item in the resourceType combo
if (resourceTypeCmb.getItemCount() > 0) {
}
public Set<String> getSearchTypes() {
+ if (null == page) {
+ return null;
+ }
return page.getSearchTypes();
}
+++ /dev/null
-#%RAML 0.8
-title: OICLight
-version: v1.0-20150910
-schemas:
- - OICLight: !include oic.r.light.json
- OICLightError: !include oic.r.light-error.json
-
-traits:
- - interface:
- queryParameters:
- if:
- enum: ["oic.if.a"]
-
-/oic/r/light:
- description: |
- Resource to be exposed by any OIC Device that can act as Light.
- displayName: OIC Light
- is: [ interface ] # valid for all methods
-
- get:
- responses:
- 200:
- body:
- application/json:
- schema: OICLight
- example: |
- {
- "rt": "oic.r.light",
- "id": "light_id",
- "power": "off"
- }
- post:
- body:
- application/json:
- schema: OICLight
- example: |
- {
- "id": "light_id",
- "power": "off"
- }
- responses:
- 200:
- body:
- application/json:
- schema: OICLight
- example: |
- {
- "id": "light_id",
- "power": "off"
- }
- 403:
- description: |
- This response is generated by the OIC Server when the client sends:
- An update with an out of range property value for intensity.
- The server responds with the range property illustrating the error.
- body:
- application/json:
- schema: OICLightError
- example: |
- {
- "id": "light_id",
- "range": "10,20"
- }
\ No newline at end of file
{
- "id": "http://openinterconnect.org/schemas/oic.r.light#",
+ "id": "simple.light#",
"$schema": "http://json-schema.org/draft-04/schema#",
- "title": "OIC Light",
- "$ref": "#/definitions/oic.r.light",
+ "title": "Simple Light",
+ "$ref": "#/definitions/light",
"definitions": {
- "oic.r.light": {
+ "light": {
"type": "object",
"properties": {
- "rt": {
+ "resourceType": {
"type": "string",
"description": "Description about resource type",
- "default": "oic.r.light"
- },
- "if": {
- "type": "string",
- "description": "Interface supported",
- "default": "oic.if.baseline"
+ "default": "sample.light"
},
"intensity": {
- "type": "integer",
+ "type": "string",
"description": "ReadOnly, Comma separated min,max values for intensity on this device",
- "default": "10,20"
+ "default": "1,20"
}
}
}
- },
- "required": ["rt","if"]
+ }
}
{
- "id": "http://openinterconnect.org/schemas/oic.r.light#",
+ "id": "simple.light#",
"$schema": "http://json-schema.org/schema#",
- "title": "OIC Light",
- "$ref": "#/definitions/oic.r.light",
+ "title": "Simple Light",
+ "$ref": "#/definitions/light",
"definitions": {
- "oic.r.light": {
+ "light": {
"type": "object",
"properties": {
- "rt": {
+ "resourceType": {
"type": "string",
"description": "Description about resource type",
- "default": "oic.r.light"
- },
- "if": {
- "type": "string",
- "description": "Interface supported",
- "default": "oic.if.baseline"
+ "default": "sample.light"
},
"power": {
"type": "string",
"description": "brightness of the light",
"default": 1,
"minimum": 1,
- "maximum": 9,
+ "maximum": 20,
"update_frequency": 1001
}
}
}
},
- "required": [ "rt","if","power" ]
+ "required": [ "resourceType", "power" ]
}
\ No newline at end of file
--- /dev/null
+#%RAML 0.8
+title: Simple Light
+version: v1.0-20150910
+schemas:
+ - LightSchema: !include simple-light.json
+ LightSchemaError: !include simple-light-error.json
+
+/sample/light:
+ description: Resource to be exposed by any Simple Device that can act as Light.
+ displayName: Simple Light
+ get:
+ responses:
+ 200:
+ body:
+ application/json:
+ schema: LightSchema
+ example: |
+ {
+ "resourceType": "sample.light",
+ "power": "off"
+ }
+ put:
+ body:
+ application/json:
+ schema: LightSchema
+ example: |
+ {
+ "power": "off",
+ "intensity": 5
+ }
+ responses:
+ 200:
+ body:
+ application/json:
+ schema: LightSchema
+ example: |
+ {
+ "power": "off",
+ "intensity": 5
+ }
+ 403:
+ description: |
+ This response is generated by the Server when the client sends:
+ An update with an out of range property value for intensity.
+ The server responds with the range property illustrating the error.
+ body:
+ application/json:
+ schema: LightSchemaError
+ example: |
+ {
+ "range": "1,20"
+ }
+ post:
+ body:
+ application/json:
+ schema: LightSchema
+ example: |
+ {
+ "power": "off"
+ }
+ responses:
+ 200:
+ body:
+ application/json:
+ schema: LightSchema
+ example: |
+ {
+ "power": "off"
+ }
+ 403:
+ description: |
+ This response is generated by the Server when the client sends:
+ An update with an out of range property value for intensity.
+ The server responds with the range property illustrating the error.
+ body:
+ application/json:
+ schema: LightSchemaError
+ example: |
+ {
+ "range": "1,20"
+ }
import oic.simulator.logger.LogEntry;
/**
- *
+ * Interface through which the log events are sent to the UI listeners.
*/
public interface ILogUIListener {
public void logAdded(LogEntry added);
}
public static Image getImage(String imagePath) {
- Image img = null;
if (null == imagePath || imagePath.length() < 1) {
- return img;
+ return null;
}
URL imageURL = Activator.getDefault().getBundle().getEntry(imagePath);
ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL);
Map<String, LocalResourceAttribute> resourceAttributeMap = null;
if (null != resourceModelN) {
Map<String, ResourceAttribute> attributeMapN;
- attributeMapN = resourceModelN.getAttributes();
+ try {
+ attributeMapN = resourceModelN.getAttributes();
+ } catch (SimulatorException e) {
+ Activator
+ .getDefault()
+ .getLogManager()
+ .log(Level.ERROR.ordinal(),
+ new Date(),
+ "[" + e.getClass().getSimpleName() + "]"
+ + e.code().toString() + "-"
+ + e.message());
+ return null;
+ }
if (null != attributeMapN) {
resourceAttributeMap = new HashMap<String, LocalResourceAttribute>();
Set<String> typeSet = orderedResourceUriMap.keySet();
List<String> typeList = Utility.convertSetToList(typeSet);
if (null == typeList || typeList.size() < 1) {
- return null;
+ return list;
}
list = new ArrayList<String>();
try {
result = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
- // Do nothing
+ System.out
+ .println("Getting UpdateInterval from string failed!");
}
}
return result;
+ e.getMessage());
} finally {
try {
- out.close();
+ if (null != out) {
+ out.close();
+ }
} catch (IOException e) {
- // Error occurred during close. Ignoring
+ System.out.println("Error occurred during close.");
}
}
}
System.out.println("Resultant config file path is "
+ configFilePath);
count = createWizard.getResourceCount();
- if (count <= 1) {
- // Single resource creation
- resourceManager.createResource(configFilePath);
- } else {
- // Multi-resource creation
- resourceManager.createResource(configFilePath,
- count);
+ if (count > 0) {
+ if (count == 1) {
+ // Single resource creation
+ resourceManager
+ .createResource(configFilePath);
+ } else {
+ // Multi-resource creation
+ resourceManager.createResource(
+ configFilePath, count);
+ }
}
}
}
.getDeleteCategory();
if (deleteCategory == DeleteCategory.BY_URI) {
String uri = deleteWizard.getDeleteCandidate();
- boolean completeURI = Utility
- .isUriComplete(uri);
- if (!completeURI) {
- uri = Utility.displayNameToUri(uri);
+ if (null != uri) {
+ boolean completeURI = Utility
+ .isUriComplete(uri);
+ if (!completeURI) {
+ uri = Utility.displayNameToUri(uri);
+ }
+ resourceManager.deleteResourceByURI(uri);
}
- resourceManager.deleteResourceByURI(uri);
} else if (deleteCategory == DeleteCategory.BY_TYPE) {
resourceManager
.deleteResourceByType(deleteWizard
}
public String getConfigFilePath() {
+ if (null == page) {
+ return null;
+ }
return page.getConfigFilePath();
}
public int getResourceCount() {
+ if (null == page) {
+ return 0;
+ }
return page.getResourceCount();
}
@Override
public boolean performFinish() {
+ if (null == page) {
+ return false;
+ }
// Check the existence of the resource if the user has entered the uri
if (page.getDeleteCategory() == DeleteCategory.BY_URI) {
// Check whether the uri is in full form or short form
}
public DeleteCategory getDeleteCategory() {
+ if (null == page) {
+ return DeleteCategory.NONE;
+ }
return page.getDeleteCategory();
}
public String getDeleteCandidate() {
+ if (null == page) {
+ return null;
+ }
return page.getDeleteCandidate();
}
}
\ No newline at end of file
*/
@SuppressWarnings("serial")
public class InvalidArgsException extends SimulatorException {
- private InvalidArgsException(int errorCode, String errMessage) {
+ public InvalidArgsException(int errorCode, String errMessage) {
super(errorCode, errMessage);
}
}
*/
@SuppressWarnings("serial")
public class NoSupportException extends SimulatorException {
- private NoSupportException(int errorCode, String errMessage) {
+ public NoSupportException(int errorCode, String errMessage) {
super(errorCode, errMessage);
}
}
\ No newline at end of file
*/
@SuppressWarnings("serial")
public class OperationInProgressException extends SimulatorException {
- private OperationInProgressException(int errorCode, String errMessage) {
+ public OperationInProgressException(int errorCode, String errMessage) {
super(errorCode, errMessage);
}
}
* @param resourceType
* Type of resource to be deleted.
*
- * @throws InvalidArgsException
- * Thrown if the input parameter is empty.
* @throws SimulatorException
* Thrown for other errors.
*/
public static void deleteResources(String resourceType)
- throws InvalidArgsException, SimulatorException {
+ throws SimulatorException {
SimulatorManagerNativeInterface.deleteResources(resourceType);
}
* @throws SimulatorException
* Thrown for other errors.
*/
- public static void findResource(IFindResourceListener listener)
+ public static void findResources(IFindResourceListener listener)
throws InvalidArgsException, SimulatorException {
- SimulatorManagerNativeInterface.findResource(listener);
+ SimulatorManagerNativeInterface.findResources(null, listener);
}
/**
public static void findResources(String resourceType,
IFindResourceListener listener) throws InvalidArgsException,
SimulatorException {
+ if (null == resourceType || resourceType.isEmpty()) {
+ throw new InvalidArgsException(
+ SimulatorResult.SIMULATOR_INVALID_PARAM.ordinal(),
+ "Resource type is empty");
+ }
SimulatorManagerNativeInterface.findResources(resourceType, listener);
}
throws InvalidArgsException, SimulatorException;
/**
- * Native function for discovering all types of resources.
- *
- * @param listener
- * Interface to receive the discovered remote resources.
- *
- * @throws InvalidArgsException
- * Thrown if the input parameter is empty.
- * @throws SimulatorException
- * Thrown for other errors.
- */
- public static native void findResource(IFindResourceListener listener)
- throws InvalidArgsException, SimulatorException;
-
- /**
- * Native function for discovering specific type of resources.
+ * Native function for discovering resources.
*
* @param resourceType
* required resource type
/**
* Constructor for creating a native resource model object. Client requests
- * such as PUT and POST uses this method for passing the new new/updated
+ * such as PUT and POST uses this method for passing the new/updated
* resource model.
*/
public SimulatorResourceModel() {
* Name of the attribute
* @param value
* Value of the attribute
+ *
+ * @throws InvalidArgsException
+ * This exception will be thrown if the attribute name is
+ * invalid.
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public void addAttribute(String name, int value) {
- addAttributeInt(name, value);
- }
+ public native void addAttributeInt(String name, int value)
+ throws InvalidArgsException, SimulatorException;
/**
* Method for adding an attribute whose value is of type double.
* Name of the attribute
* @param value
* Value of the attribute
+ *
+ * @throws InvalidArgsException
+ * This exception will be thrown if the attribute name is
+ * invalid.
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public void addAttribute(String name, double value) {
- addAttributeDouble(name, value);
- }
+ public native void addAttributeDouble(String name, double value)
+ throws InvalidArgsException, SimulatorException;
/**
* Method for adding an attribute whose value is of type boolean.
* Name of the attribute
* @param value
* Value of the attribute
+ *
+ * @throws InvalidArgsException
+ * This exception will be thrown if the attribute name is
+ * invalid.
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public void addAttribute(String name, boolean value) {
- addAttributeBoolean(name, value);
- }
+ public native void addAttributeBoolean(String name, boolean value)
+ throws InvalidArgsException, SimulatorException;
/**
* Method for adding an attribute whose value is of type string.
* Name of the attribute
* @param value
* Value of the attribute
+ *
+ * @throws InvalidArgsException
+ * This exception will be thrown if the attribute name is
+ * invalid.
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public void addAttribute(String name, String value) {
- addAttributeString(name, value);
- }
+ public native void addAttributeString(String name, String value)
+ throws InvalidArgsException, SimulatorException;
/**
* Method for getting the number of attributes this model comprised of.
*
* @return Number of attributes.
+ *
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public native int size();
+ public native int size() throws SimulatorException;
/**
* Method for getting all attributes.
*
* @return Map of attributes with attribute name as the key and its
* corresponding {@link ResourceAttribute} object as the value.
+ *
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public native Map<String, ResourceAttribute> getAttributes();
+ public native Map<String, ResourceAttribute> getAttributes()
+ throws SimulatorException;
/**
* Method for getting a specific attribute by its name.
* Name of the attribute
*
* @return An object of {@link ResourceAttribute}.
+ *
+ * @throws InvalidArgsException
+ * This exception will be thrown if the attribute does not
+ * exist.
+ *
+ * @throws SimulatorException
+ * This exception will be thrown either if the resource model is
+ * not found or for some general errors.
*/
- public native ResourceAttribute getAttribute(String attrName);
-
- private native void addAttributeInt(String name, int value);
-
- private native void addAttributeDouble(String name, double value);
-
- private native void addAttributeBoolean(String name, boolean value);
-
- private native void addAttributeString(String name, String value);
+ public native ResourceAttribute getAttribute(String attrName)
+ throws InvalidArgsException, SimulatorException;
private SimulatorResourceModel(long nativeHandle) {
this.nativeHandle = nativeHandle;
@Override
protected void finalize() throws Throwable {
- dispose();
+ try {
+ dispose();
+ } catch(Throwable t){
+ throw t;
+ } finally{
+ System.out.println("Calling finalize of Super Class");
+ super.finalize();
+ }
}
private native void create();
@Override
protected void finalize() throws Throwable {
- dispose();
+ try {
+ dispose();
+ } catch(Throwable t){
+ throw t;
+ } finally{
+ System.out.println("Calling finalize of Super Class");
+ super.finalize();
+ }
}
/**
throws InvalidArgsException, SimulatorException;
/**
- * Native function to set the observation callback.
+ * Native function to set callback to receive the clients information who are started or stopped observing the simulated resource.
*
* @param observer
* Listener to be notified when clients start/stop observing.