dev@glassfish.java.net

Re: Example of support for --target option?

From: Vijay Ramachandran <vijay.ramachandran_at_oracle.com>
Date: Fri, 11 Jun 2010 10:48:18 -0700

> 1. Does command replication mean that a) it can be executed against
> any type of target,

Yes.

> or b) that if it is executed, it is repeated automatically on all
> instances in a cluster?

The replication framework will look at the target type, ensure that the
target type is supported by the command being executed, executes the
command on DAS. If execution on DAS succeeds AND the command's @Cluster
has RuntimeType.INSTANCE AND the target type indicates to the framework
that the command should replicated on instances (typically target types
which are config type, stand alone server type, cluster type), then the
command is replicated. If the target type is stand alone server, the
replication happens only on that instance. If it is cluster it happens
on all instances that are part of that cluster.

> 2. You point to 'create-custom-resource' CLI that can be executed not
> only on an instance or a cluster, but also on a server or a domain.
> What do the last 2 choices mean?

server = the string 'server' without the quotes = DAS
domain = the string 'domain' without the quotes = target is only the domain

To my knowledge, not many commands support domain target type. A vast
majority of the commands support config, 'server', cluster and stand
alone server as target types. More info on this will be added to the
target type section
<http://wiki.glassfish.java.net/Wiki.jsp?page=CLIDeveloperGuide#section-CLIDeveloperGuide-EnforcingTargetTypesAllowedForCommands>
in the wiki.

Vijay

>
> 3. Please add a link to an example of correct implementation of a CLI
> that does correct processing for the --target value.
>
> thanks,
> -marina
>
>
> Vijay Ramachandran wrote:
>> I have updated the wiki
>> <http://wiki.glassfish.java.net/Wiki.jsp?page=CLIDeveloperGuide> with
>> more info, pointers to code samples, added section with answers to
>> FAQ etc
>>
>> Let me know if you would like to see more info
>>
>> Vijay