Issue Details (XML | Word | Printable)

Key: HERASAFXACMLCORE-98
Type: Improvement Improvement
Status: Closed Closed
Resolution: Incomplete
Priority: Minor Minor
Assignee: René Eggenschwiler
Reporter: Wolfgang Giersche
Votes: 0
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
HERAS-AF XACML Core

It should be possible to default-initialize the JAXB Context in a single method call without having a PDP implementation

Created: 08/Jan/10 02:37 PM   Updated: Friday 04:21 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0-M2

Time Tracking:
Original Estimate: 5 hours
Original Estimate - 5 hours
Remaining Estimate: 0 minutes
Time Spent - 31 minutes
Time Spent: 31 minutes
Time Spent - 31 minutes Time Not Required

File Attachments: 1. Text File 98-1.patch (7 kB)

Issue Links:
Reference
 
Relate
 

Issue Links:


 Description  « Hide
It takes either SimplePdpFactory or a total of 5 different Initializer calls to be able to parse a policy-file. The initializing obviously has something to do with JAXB Parsing, not the PDP. Thus a client that only wants to read a file, should have a possibility to initialize the JAXB Environment easily prior to using PolicyConverter.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Chad La Joie added a comment - 08/Apr/10 04:13 PM - edited
Patch 98-1 adds an initializeJAXBContextAndPolicyConfiguration() method to the ContextAndPolicy helper class. ContextAndPolicyInitializer now calls this method.

Users who only need to initialize the JAXB support can now call ContextAndPolicy.initializeJAXBContextAndPolicyConfiguration() directly.


Chad La Joie added a comment - 08/Apr/10 04:14 PM
Yours to review, Florian.

Florian Huonder added a comment - 10/Apr/10 12:04 PM - edited
Hi Chad,

I have a small comment on your patch.

  • I don't know why but I have some problems with applying it, it always has errors. But I think I can handle it.
  • I think (unless I overlooked it) the patch does not solve the problem because it does load the jaxb stuff (formatted output etc) but it does not initialize the functions, data types etc. When marshalling and unmarshalling the JAXB-Type adapters will fail. This factory method must also call all initializers (currently all initializers are only for jaxb stuff).

Hmm... Now when writing some questions arise in my brain :
In my opinion it requires two factories. One for PDP initialization and one for jaxb initialization. The PDP factory also calls the jaxb factory but the jaxb factory can be used standalone.
If this setup would be implemented we must also think about the initializers. Do we now need to kinds of initializers?
A JAXBInitializer that is only applicable to the jaxb factory and a PDP initializers that is only applicable to the PDP factory (these pdp initializers would also have access to the PDP object).

What do you think?


Chad La Joie added a comment - 12/Apr/10 01:47 PM
Yes, I see what you mean. I'll think about it a bit more and submit another patch with what I come up with.

Chad La Joie added a comment - 21/Apr/10 04:10 PM
I've looked over this again. I see that the current function/datatype/etc initializers employ classpath scanning. This is very complex code and is unlikely to work in a number of environments (e.g. OSGi, Google App Engine, certain web application containers). Is there a real reason why this shouldn't be done as it has been done in the past; new an instance of the object and just register it with the appropriate Converter class?

I could understand doing this type of classpath scanning if it wasn't so brittle and if it picked up more than just HERAS defined types. But it is brittle and it doesn't support anything other than HERAS types. So I would strongly recommend simplifying this code.


Florian Huonder added a comment - 12/May/10 10:57 AM
Sorry for my late response. The issue went under.

We do the scanning to be able to automatically pick up the e.g. function classes within the functions package. This to not be forced to initialize all 209+ functions "by hand" within the initializer.
We are certain that it is a usable way to handle this.

Your objection about environment that maybe don't work (OSGi, Google App Engine, ...) I think that we are very open to make the experience with those. I am willing to create test for all of these. I also would take it on my list of todos.

The reason that I am not convinced to throw everything into trash and make it the very simple way is that we think this is a very neat way of getting all those e.g. functions into the JAXB stuff.
I fully understand your point of view to say "why classpath scanning when it would work without". But if you could live with it I am really wanted to give our approach a chance to proof.


René Eggenschwiler added a comment - 21/May/10 04:55 PM
This issue will be again discussed when solving the issue HERASAFXACMLCORE-124.
We can agree with Chad that for the basic types of HERAS-AF the dynamic classloading is a little bit overengineered.
We will change that most probably.

On the other hand we still will try to provide (an optional) possibility for users to dynamically add their own types.


Florian Huonder added a comment - 03/Sep/10 12:29 PM
After HERASAFXACMLCORE-124 has been completed it is now possible to call

JAXBInitializer.run();
After this the whole JAXB stuff is initialized and the following classes can be properly used:

  • PolicyMarshaller
  • RequestCtxFactory
  • RequestCtx
  • ResponseCtxFactory
  • ResponseCtx