admin@glassfish.java.net

Re: V3 configuration data types API change (please read)

From: Tim Quinn <Timothy.Quinn_at_Sun.COM>
Date: Fri, 25 Jan 2008 17:03:16 -0600

Jerome Dochez wrote:
> There would be a slightly different way of doing this. I have not
> completed the APIs yet but
Will this include a way for the code to select which specific
configuration is of interest (default, instance-A, cluster-X, etc.) so
the injection would provide that specific configuration's value for
HttpListener?

This looks pretty nice.

- Tim
> the basic idea out be :
>
> @Inject
> HttpListener httpListener; // you get the translated view
>
> httpListener.getPor() ---> 8080
>
> Somewhere now you want the raw value, you do ...
>
> HttpListener rawHttpListener = ConfigUtils.getRawView(httpListener);
> rawHttpListener.getPort() ----> ${com.aas.instance.httpPort}
>
> Another example of views is WriteableViews :
>
> httpListener.setPort("foo.bar")
>
> would trigger an exception but...
>
> HttpListener writeableView = ConfigUtils.getWriteableView(httpListener);
> writeableView.setPort("${com.foo.bar") // when writing, you always
> write to Raw
>
> HTH, Jerome