[Design the new POJO MicroContainer] - Re: Concurrent deployments
by bela@jboss.com
"adrian(a)jboss.org" wrote : Couldn't you just implement this anyway in your services,
| using the 2PC create/start lifecycle?
|
|
| | private volatile Thread startupThread;
| |
| | public void create() throws Exception
| | {
| | startupThread = new Thread(new Runnable()
| | {
| | public void run()
| | {
| | // start channel here
| | }
| | });
| | startupThread.start();
| | }
| |
| | public void start() throws Exception
| | {
| | startThread.join(); // wait for startup to complete before injecting ourselves onto others
| | startThread = null;
| | }
| |
|
| Of course, we could do better (e.g. using thread pools and "optimizing"
| related work across threads based on dependencies) if this was a feature of the MC.
No, since create only creates the channel, but start() connects it (time consuming operation), we'd block the main thread for the same time with the join() as if we deployed on the main thread directly.
We could create a separate threads and not join() it, but that might have unintended consequences, such as channels not being ready when JBossCache (which has a dep on a channel) starts...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131439#4131439
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131439
18 years, 1 month
[Design the new POJO MicroContainer] - Re: ClassLoadingMetaData ease-of-use
by adrian@jboss.org
"scott.stark(a)jboss.org" wrote :
| The only possible usage would be to obtain package annotations, but then is that really an empty package?
|
No there is a package-info.class
anonymous wrote :
| This really seems like a management interface issue where I want to be able to ask, what are the package export filters that apply to the class loader. From that perspective, the includedExport is just an alias for a type of capability (package, custom).
|
I'm working on it. I can't do everything at once. ;-)
Once I've done the management features you requested,
then I'll add ManagedOperations/Statistics to the ClassLoadingMetaData
ManagedObject. This can include the packages exported by a classloader,
classes/resources loaded, etc., although I'm only going to do a basic
set for the initial release as a "proof of concept", then you, me or somebody else
can add extra features.
anonymous wrote :
| However, since you can't use a namespace in an attribute value, how would you specify something other than a package filter? Given that, I would say the includedExport is only used for package filtering, and we can decide if we want better detection of conflicting statements that end up in an empty export set in the management interface.
|
I haven't enabled the full ClassFilter functionality in the xml or ManagedObject yet,
because the ClassFilter stuff needs fixing to be serializable.
I'll do them as elements so you can properly customize it.
With xml wildcards, etc. to define your own.
WARNING THIS DOES NOT EXIST YET
e.g. something like:
| <classloading ...>
| <!-- builit in-->
| <include type="RegExp">javax\.ejb\..+</include>
| <!-- or equivalently -->
| <include type="Glob">javax.ejb.**</include>
| <!-- user defined -->
| <include type="Custom"><myfilter xmlns="whatever" ..../></include>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131438#4131438
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131438
18 years, 1 month
[Design the new POJO MicroContainer] - Re: Concurrent deployments
by bela@jboss.com
"adrian(a)jboss.org" wrote :
|
| * Not all services define their dependencies properly. It's only the implicit
| sequential order that makes them work correctly
|
The let's make the default sequential unless we explicitly tag a deployment as asynchronous (as you mention further down). Although I'd prefer it to be the other way round.
anonymous wrote :
| * The Sun classloading doesn't work very well concurrently. We avoid a number of potential problems by doing a sequential load of most of the key classes during the bootstrap.
|
What prevents us from loading those key classes up front, and then deploying in parallel ?
anonymous wrote :
| * The "big ball of mud" unified classloader depends for consistency/predictability on having the classloaders created in order. It is this order that is used to search for global classes. If these were registered concurrently across threads the search order would be unpredicatble across different reboots.
|
The big ball of mud is controlled by us, right ? So we can change it. The above sounds like a kludge anyway... (Caveat, I'm not a classloader expert... :-))
[quote
* The old 4.x MicroKernel has some thread safety issues,
e.g. invocations of create/start are done in synchronized blocks which could cause deadlock problems, there are others related to ConcurrentModificationExceptions.
This is not an issue with the 5.x Microcontainer.
Then the feature is for AS 5 only, and not available in 4.x.
anonymous wrote :
| * We'd need to find a way for the BarrierService and "Server Started" notification to know when all the startup threads have finished, otherwise
| they would be broken.
|
Yes. One big barrier would probably be enough to sync on for all threads when they're completed, at least in a first impl. This would tell us that startup of JBossAS is 'done'.
anonymous wrote :
| * Finally, less of a practical issue, but more a generic note. Using mulitple threads for startup will only work if there are multiple cpus/cores. In non SMP environments the bootstrap could be slower with multiple competing threads, although
| it may be able to take advantage of times during disk I/O waits
| to do some processing on other threads?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131435#4131435
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131435
18 years, 1 month
[Design the new POJO MicroContainer] - Re: ClassLoadingMetaData ease-of-use
by scott.stark@jboss.org
"adrian(a)jboss.org" wrote :
| The issues would be around contradictory specifications, e.g.
|
| | <classloader exportAll="ALL" excludeExport="p1">
| | <capability>
| | <package name="p1"/>
| | ...
| |
|
| So is p1 in the exports or not? ;-)
|
| There's probably other more complicated examples.
| Especially since I didn't mention that although these filters are shown
| as lists of packages, I'm potentially allowing any ClassFilter and wildcard
| capabilities so I don't necessarily know exactly what they mean,
| although I do know if the Capability implements ExportPackages
| which is part of the way.
So we have,
exportAll="ALL|NON_EMPTY" - an alias for includedExport="*|NonEmptyPackageFilter"?
included - define what is visible as input to the module itself via inclusion rules.
excluded - define what is visible as input to the module itself via exclusion rules.
includedExport,capability - define what can be exported from module's available content.
So in the example above, the overlapping p1 specifications could mean an empty p1 package was exported. If it was exportAll="NON_EMPTY", then p1 would not show up as a capability. This leads to the question: what does it mean to resolve a package to a module that only has an empty version of it? Generally this would not be meaningful. The only possible usage would be to obtain package annotations, but then is that really an empty package?
This really seems like a management interface issue where I want to be able to ask, what are the package export filters that apply to the class loader. From that perspective, the includedExport is just an alias for a type of capability (package, custom). However, since you can't use a namespace in an attribute value, how would you specify something other than a package filter? Given that, I would say the includedExport is only used for package filtering, and we can decide if we want better detection of conflicting statements that end up in an empty export set in the management interface.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131424#4131424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131424
18 years, 1 month