[JBoss Microcontainer Development] - Removing cached entry in VFSCLPolicy on load
by Ales Justin
Ales Justin [http://community.jboss.org/people/alesj] created the discussion
"Removing cached entry in VFSCLPolicy on load"
To view the discussion, visit: http://community.jboss.org/message/549039#549039
--------------------------------------------------------------
Does something like this make sense to add directly, or should it be optional?
public VFSClassLoaderPolicy(String name, VirtualFile[] roots, VirtualFile[] excludedRoots)
{
...
this.excludedRoots = excludedRoots;
+ addClassFoundHandler(new VFSCacheRemove());
}
+
+ private class VFSCacheRemove implements ClassFoundHandler
+ {
+ public void classFound(ClassFoundEvent event)
+ {
+ String className = event.getClassName();
+ String path = ClassLoaderUtils.classNameToPath(className);
+ vfsCache.remove(path); // remove the entry once we loaded the class
+ }
+ }
}
This would definitely decrease the memory, since every already loaded class's lookup cache would be released.
And with CL cache fixed, we access the class on next invocaton directly form CL cache, hence no need to path cache.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549039#549039]
Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
Re: [jboss-dev-forums] [JBoss Microcontainer Development] - Endless loop at AS server startup
by Ales Justin
Ales Justin [http://community.jboss.org/people/alesj] replied to the discussion
"Endless loop at AS server startup"
To view the discussion, visit: http://community.jboss.org/message/549028#549028
--------------------------------------------------------------
> The cache may have side effects because the code in #4 and #5 is not always executed when a client calls #3.
> Could you please review carefully or alternatively change the algorithm so it becomes usable for large sets of reqs/caps and mods.
Adding this patch doesn't change AS boot time in measurable way, at least not for default and all.
Index: classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java
===================================================================
--- classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java (revision 106215)
+++ classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java (working copy)
@@ -85,6 +85,9 @@
/** The requirements */
private List<RequirementDependencyItem> requirementDependencies;
+
+ /** Already resolved dependency items */
+ private Map<RequirementDependencyItem, Module> resolved;
/** Any lifecycle associated with the classloader */
private LifeCycle lifeCycle;
@@ -94,7 +97,7 @@
/** Requirements resolved to us */
private Set<RequirementDependencyItem> depends = new CopyOnWriteArraySet<RequirementDependencyItem>();
-
+
/**
* Register a classloader for a module
*
@@ -1191,6 +1194,7 @@
addIDependOn(item);
requirementDependencies.add(item);
}
+ resolved = new ConcurrentHashMap<RequirementDependencyItem, Module>();
}
}
@@ -1205,6 +1209,7 @@
removeIDependOn(item);
}
requirementDependencies = null;
+ resolved = null;
}
/**
@@ -1216,7 +1221,10 @@
if (requirementDependencies != null && requirementDependencies.isEmpty() == false)
{
for (RequirementDependencyItem item : requirementDependencies)
+ {
item.unresolved(controller);
+ resolved.remove(item);
+ }
}
}
@@ -1336,14 +1344,33 @@
*/
protected Module resolveModule(RequirementDependencyItem dependency, boolean resolveSpace)
{
+ if (resolved != null)
+ {
+ Module resolvedModule = resolved.get(dependency);
+ if (resolvedModule != null)
+ return resolvedModule;
+ }
+
ClassLoadingSpace space = getClassLoadingSpace();
if (resolveSpace && space != null)
space.resolve(this);
+ if (resolved != null)
+ {
+ Module resolvedModule = resolved.get(dependency);
+ if (resolvedModule != null)
+ return resolvedModule;
+ }
+
Requirement requirement = dependency.getRequirement();
- return checkDomain().resolveModule(this, requirement);
+ Module result = checkDomain().resolveModule(this, requirement);
+
+ if (result != null && resolved != null)
+ resolved.put(dependency, result);
+
+ return result;
}
> Perhaps these large sets should be mocked in the CL testsuite.
But I guess, as you mentioned, it will only show in osgi config, with compendiums large requirement set.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549028#549028]
Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[JBoss ESB Development] - Durable Subscriptions - JMS Listeners
by Tom Fennelly
Tom Fennelly [http://community.jboss.org/people/tfennelly] created the discussion
"Durable Subscriptions - JMS Listeners"
To view the discussion, visit: http://community.jboss.org/message/548994#548994
--------------------------------------------------------------
I'm looking at adding durable subscriptions for the JMS listeners ala https://jira.jboss.org/browse/JBESB-1890 https://jira.jboss.org/browse/JBESB-1890
What I have at the moment results in a config like the following (note the +durableSubscriptionName+ attribute):
<jms-listener name="JMS-Gateway" busidref="quickstart-topic" is-gateway="true" durableSubscriptionName="quickTopic_service2" />
So... at the moment it's not actually on the <jms-message-fileter> config as per the JIRA. I think it needs to be on the listener because each subscriber needs to have a unique subscription name, or you get an exception from the JMS Provider i.e. if you have 2 listeners listening to the same topic and both are durable, they both need to have unique subscription names i.e. it's on a per listener basis.
There's also a new (optional) clientId attribute on the jms-listener. This is needed for durable subs. It is set on the associated JMS Connection, which means it becomes part of the pool key, so as to have a connection pool per clientId. If the clientId is not configured on the listener (but +durableSubscriptionName+ is configured), we default to the clientId to the listener name value.
Does this seem OK, or am I mising something?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548994#548994]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[JBoss ESB Development] - JMX (mbean) with JBossESB service
by Steam s
Steam s [http://community.jboss.org/people/sbutt] created the discussion
"JMX (mbean) with JBossESB service"
To view the discussion, visit: http://community.jboss.org/message/548981#548981
--------------------------------------------------------------
Hi Folks,
I have an esb service which is currently responsible for doing some routing (calling another esb service via serviceCat:serviceName:maxthread) pattern. I'm using XSLT transformation to generate the above service call, but now want to make it dynamic. That is by feeding the string (serviceCat:serviceName:maxthread) through DB at runtime.
So what I'm looking for is some kind of solution to inject the service call / routing information into my esb service through JMX mbean.
JMX bean should be able to load/reload (serviceCat:serviceName:maxthread) information at runtime (from the DB) into my esb service, which i should then call asynchronously through service invoker method.
Any pointers on how to use jmx with esb services? i didn't fine any good example on this.
thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548981#548981]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months