[JBoss OSGi Development] - Handling of Bundle-ClassPath
by thomas.diesler@jboss.com
The Bundle-ClassPath is now handles in OSGiClassLoaderFactory like this
| public ClassLoaderPolicy createClassLoaderPolicy()
| {
| VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
| OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
| VirtualFile[] roots = getClassLoaderPolicyRoots(bundleState, vfsUnit);
| return new OSGiClassLoaderPolicy(bundleState, roots);
| }
|
| private VirtualFile[] getClassLoaderPolicyRoots(OSGiBundleState bundleState, VFSDeploymentUnit vfsUnit)
| {
| VirtualFile root = vfsUnit.getRoot();
|
| // If there is no Bundle-ClassPath in the manifest, simply use the root
| List<String> bundleClassPath = bundleState.getOSGiMetaData().getBundleClassPath();
| if (bundleClassPath == null)
| {
| return new VirtualFile[] { root };
| }
|
| log.debug("Bundle-ClassPath: " + bundleClassPath);
|
| // Add a vfs root for every Bundle-ClassPath element
| List<VirtualFile> rootsList = new ArrayList<VirtualFile>();
| for (String path : bundleClassPath)
| {
| if (path.equals("."))
| {
| rootsList.add(root);
| }
| else
| {
| try
| {
| VirtualFile child = root.getChild(path);
| rootsList.add(child);
| }
| catch (IOException ex)
| {
| throw new IllegalArgumentException("Cannot find class path '" + path + "' in: " + root);
| }
| }
| }
|
| VirtualFile[] rootsArray = new VirtualFile[rootsList.size()];
| rootsList.toArray(rootsArray);
|
| return rootsArray;
| }
|
Note, I create a policy root entry for every bundle class path token.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259229#4259229
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259229
16 years, 6 months
[jBPM Development] - Timer dueDate / dueDateTime
by vchira
Hi. I have a problem with jbpm Timers. First i don't understand why you can't have a timer for Transition that are going to or from a java task. Second problem that I have is with dueDate /dueDateTime... i found no way to specify the dueDate als java.util.Date. I find this weird because the dueDate attribute in TimerImpl is of type Date! I think this Problem can be fixed with the following code in TimerImpl:
| public void setDueDateDescription(String dueDateDescription) {
|
| ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
| Object dueDateEvaluated = scriptManager.evaluateExpression(dueDateDescription, null);
| if(dueDateEvaluated instanceof Date)
| {
| dueDate =dueDateEvaluated;
| return;
| }
| dueDateDescription = (String) dueDateEvaluated;
|
| Duration duration = new Duration(dueDateDescription);
| Date now = Clock.getCurrentTime();
|
| ...........................................
| }
|
a better solution would be to add a dueDateTimeDefinition in TimerDefinitionImpl and in JobParser.parseTimerDefinition() just set the definition there. after that in ScopeInstanceImpl.createTimer() evaluate dueDateTimeDefinition and if the evaluation returns a Date just set it in dueDate otherwise pare dueDateTimeDefinition as a date String..like you do now in JobParser.parseTimerDefinition().
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259183#4259183
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259183
16 years, 6 months