dev@glassfish.java.net

Re: AMX (DeploymentMgr)

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Fri, 21 Jul 2006 13:15:06 -0700

Responses inline.

On Jul 21, 2006, at 10:43 AM, Kohsuke Kawaguchi wrote:
> Lloyd L Chambers wrote:
>> Yes, do use JSR 88 to deploy. We are aware of the awkward
>> "switch" between JSR 88 and AMX and we do plan to do something
>> about it.
>
> Cool. That would be nice.
>
>> There can be many http listeners. You need to get the
>> Map<String,HTTPListenerConfig> via:
>> String configName = "server-config"; // for Glassfish default
>> final ConfigConfig config = domainRoot.getDomainConfig
>> ().getConfigConfigMap().get( configName );
>> Map<String,HTTPListenerConfig> listeners =
>> config.getHTTPServiceConfig ().getHTTPListenerConfigMap();
>> for( final HTTPListenerConfig listener : listeners ) {
>> System.out.println( listener.getName() + ": " +
>> (listener.getEnabled() ? "enabled" : "disabled") );
>> System.out.println( listener.getname() + " port: " + getPort();
>> }
>
> Thanks.
>
>> Unless you've created more listeners, there is generally one http
>> port and one http port with SSL enabled. In Glassfish, the port
>> should be a number; in the Enterprise Edition it could be $
>> {HTTP_LISTENER_PORT}, and it would need to be resolved to an
>> actual number, which depends on the particular instance.
>
> I suspect this would be a bit of surprise for AMX users. Why do
> users need to resolve a macro like this?

A get/set operation would destroy the macro if the port were resolved
automatically.

int port = listener.getPort(); // assume it *was* $
{HTTP_LISTENER_PORT}, but resolves to a number automaticallyl
listener.setPort( port ); // value is now whacked to fixed value

>
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com