[Design the new POJO MicroContainer] - Re: Does ScopeKey need to maintain a sorted (in ScopeLevel.l
by adrian@jboss.org
I don't understand why you have to change the ScopeKey?
I do understand that making it immutable with a builder is a better design, but
you're likely to break things if you change the semantics of the api.
THE PROBLEM:
If you go back to Jason's comments he talks about using a builder to create
a ScopeKey, but that's all a scope key really is.
The brain dead part is that it gets used at runtime in the BasicMetaDataRepository
as the key to a map which it then freezes to avoid mutablity.
The issue being that you still could incur contention because
of the synchronization on the scopes within the ScopeKey traversed in equals()/hashCode().
SOLUTIONS:
There are at least two ways you can fix this without changing the external api.
(The suggestions on improving the internal implementation should still be done)
1) Rather than having the synchronization and freeze() you could just
clone() the ScopeKey so that nobody can modify the ScopeKey once it is used by
the MDR (it is a different object), making the synchronizations irrelevant
but getting the same semantics.
2) The other is as I mention above. Use the ScopeKey as the builder class
and retrieve a more optimizated key for internal use within the MDR.
e.g. something like:
| public class ScopeKey
| {
| ...
|
| Object getOptimzedKey() {} // Key for use at runtime
| }
|
In fact (1) and (2) are just variations on the same theme, with (2) potentially
being more optimal.
POST SCRIPT
One further optimization would be to cache the hashCode()
since the key is used in ConcurrentHashMap. But I don't know that it is called
enough times (outside bootstrap/configuration) to make that worthwhile?
But, you're obviously seeing something to have looked at this in the first place?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249014#4249014
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249014
16 years, 7 months
jboss ssl connectivity error to LDAP Directory server
by Sharath Chalasani
Hello there,
I have jboss running with ssl enabled on it with a PKCS12 form of keystore,
which has all the certs(including root certs) imported into it
I also have a LDAP directory server running with ssl enabled on it
which has the JKS form of keystore(with all certs and root certs imported in it)
A seam app is deployed on jboss, connectivity is made between JBOSS and
LDAP Directory server, though LDAP api jar, implementing the ssl code in it.
Through this connection, the data in the seam app can be viewed in LDAP Directory server. Any changes made to
the data in seam app, reflects in Directory Server also.
This connection is using the non-ssl port.
Now even if I mention the ssl port (9636) of LDAP Server, in properties file, where the connection parameters are declared
I get an LDAP Exception Error(false, cannot connect to any servers in properties file).
Is this something, where I need to change anything on jboss side, in properties-service.xml or server.xml
or any other conditions.
Note - The keystore in jboss has all the certs including cert of LDAP Server and root cert imported in it
and keystore and truststore of LDAP Server also has all the certs including the jboss cert and the root cert imported in it
Error I am getting on LDAP Side --
|--> conn=547 op=3 UnbindRequest {}
2009-08-07 10:02:17,327 |localhost~090807094931|*** conn=548 CLIENT(127.0.0.1:55383) connected on SERVER(127.0.0.1:9636)
2009-08-07 10:02:17,429 |localhost~090807094931|*** conn=548 CLIENT(127.0.0.1:55383) disconnected: Unrecognized SSL message, plaintext connection?
2009-08-07 10:02:17,429 |localhost~090807094931|
Error on jboss side
-->
LDAP Exception - Cannot connect to any servers in properties file
Thanks in Advance
Sharath
See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/
16 years, 8 months
[Design the new POJO MicroContainer] - Re: Does ScopeKey need to maintain a sorted (in ScopeLevel.l
by jason.greene@jboss.com
"alesj" wrote : "jason.greene(a)jboss.com" wrote : This class should *definitely* be immutable.
| I don't think this class was ever meant to me immutable,
| otherwise there wouldn't be a freeze()/isFrozen() methods.
|
| Afaik the idea is to have it mutable/dynamic to a certain point,
| e.g. different layers add different scopes,
| once we're past of allowing this additions we freeze it in order to be able to do deterministic lookups.
|
Right, I am saying that this class wants to be immutable and that the freeze/unfreeze is just a hack to make the current approach work . Its primary purpose is to represent a "path" to a scoped value, which is logically a fixed construct. As you mention, the mutation methods are just there to make assembling it easier, however this introduces a number or problems:
| * Collections need fixed keys, so now you have to "freeze" it somehow
| * Since the object is passed between threads you need to synchronize state now. This ends up being very costly on a heavily accessed object, since even a non-contended lock still triggers a cpu fence, which typically involves waiting on particular cycle (wmb etc), and invalidates portions of the cpu cache.
| * The usage is now error-prone. What if someone forgets to freeze? What if they don't check that it's frozen before they modify it?
|
There are other better ways to have easy assembly of a immutable class:
If all scope path elements are known, a varargs constructor / factory
| scopeKey = new ScopeKey(serverScope, deploymentScope, classScope);
|
If the assembly process is done in a phased multi-participant process, than a chained-copy constructor can be used:
| parentScopeKey = new ScopeKey(serverScope);
| ....
| childKey = new ScopeKey(parentScopeKey, deploymentScope, classScope)
|
If you prefer a even more flexible assembly approach, then a builder can be used:
| builder = new ScopeKeyBuilder();
| builder.add(parentScopeKey, deploymentScope, classScopeA);
| builder.remove(classScopeA);
| builder.add(classScopeB);
|
| key = builder.toScopeKey();
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248510#4248510
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248510
16 years, 8 months
[Design of JBoss jBPM] - Re: [BPMN2] How to implement uncontrolled sequence flow beha
by tom.baeyens@jboss.com
I could not offer a stable API for activity implementations if it would have to cover all the jPDL functionality. That's why jPDL sometimes casts to implementation classes. Ideally the ActivityBehaviour interfaces would expose all necessary functionality. But time to get all that figured out and stable was not there. So I opted to start with an ActivityBehaviour API that only covers the basics. That gives us more time to explore our options before we promote that to supported API (read cast in stone).
Same is true for parsing. We could offer a more limited API to build up the process model. But that is going to take more research to get it right.
I don't think it is a big problem if implementing a new language for now requires the use of our internal PVM classes. I focussed first on the client API and the typical user pluggability like EventListeners and automatic activities.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248506#4248506
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248506
16 years, 8 months
[Design of POJO Server] - Re: Deploying ValidatorFactory
by epbernard
"alesj" wrote : "epbernard" wrote :
| | Do you know how things are push to JNDI
| |
| Sure. There is 1M ways to do it. ;-)
|
Dude I have 2 millions things to do, am juggling with 8+ code bases atm, need to finish the spec, help finish the EE6 integration, waste time in political BS and prepare my move all that under a very very tight schedule.
Can you show me one way to do it (like an example, existing code or something)?
anonymous wrote :
| "epbernard" wrote :
| | is that the deployer's responsibility?
| |
| Do you want it to be?
|
| Or we can leave it to services (its containers) to push it.
| Or what does the spec say? :-)
|
I just want to do what's recommended in AS, what is the recommended approach?
The way the specs are worded and the APIs are designed, the container needs to push a ValidatorFactory into JPA and JSF at their respective initialization time. The container also has to make VF available via JNDI and let it be injectable via @Resource.
Aside from these constraints, we can do what we want.
anonymous wrote :
| "epbernard" wrote :
| | I don't know the AS structure, where should such a code live on?
| |
| It can be here:
| - http://anonsvn.jboss.org/repos/jbossas/projects/
| Or it can even live in your BV code, as a separate module.
|
| The only thing that is important is that it's properly pushed into our mvn repo.
got it, we'll put it in http://anonsvn.jboss.org/repos/jbossas/projects/
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248504#4248504
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248504
16 years, 8 months