choreos / choreos_middleware

CHOReOS will implement service middleware support, effectively enabling the deployment of adaptable, QoS-aware choreographies in the ULS Future Internet, integrating and further evolving the latest research advances in the area of Grid and Cloud computing, Enterprise Service Bus (ESB), and pervasive computing. Service-oriented middleware enables adaptable choreographies over ESB-based middleware, Grids, Clouds, and technologies for the Internet of Things, thus overcoming scalability and heterogeneity issues of the Future Internet.
http://www.choreos.fr
Mozilla Public License 2.0
9 stars 6 forks source link

Properly accessing resources #11

Open leonardofl opened 11 years ago

leonardofl commented 11 years ago

Each project has its own resources folder. But when project A uses project B, and the JVM is started in the context of the project A, classes in project B will search for resources in the project A resources folder!

Currently we are accessing resources with the classLoader.getSystemResource() method.

Two points where this causes problems:

1) ChefNodeNameRetriever (Commons project) is searching my_chef_name.sh in the Deployment Manager project. Currently this is handled with the duplication of the my_chef_name.sh resource in both projects.

2) Choreography Deployer integration tests should the Deployment Manager, but this step is not working because the way like the RecipeBuilder access the resources. The workaround now is manually starting the Deployment Manager server and after running the Choreography Deployer test. But the right fix would be making the RecipeBuilder properly accessing the resources.

I'm not sure about the best solution, but in a Python project, Eduardo helped me to find the following solution: the source code knows the resource relative path and access it through the absolute path, joining the source file absolute path to the relative path. However some research is necessary to find the best Java way to do this.

leonardofl commented 11 years ago

Obs: the DeploymentManager Config tries to load the following file (path in my machine): /home/leonardo/workspaces/choreos/choreos_middleware/ChoreographyDeployer/file:/home/leonardo/.m2/repository/org/ow2/choreos/DeploymentManager/0.0.1-SNAPSHOT/DeploymentManager-0.0.1-SNAPSHOT.jar!/deployment.properties

An to this path, the command "new FileReader(new File(path))" executed in the ChoreographyDeployer project throws the FileNotFoundException.