On 12/10/12 4:22 AM, leisore wrote:
> Hi,
>
> For the style of GFv3 command name, I have some doubts.
>
> I find that some commands name start with "_", others start with
> "__"(two "_"),
> and the rests are normal, just start with a letter.
>
> For example:_deploy, __create-user-group, deploy
>
> At first I thought the commands starting with "_" and "__" are private,
> that means
> user can't see or execute these commands(in fact, the documents of GFv3
> didn't describe
> these commands). But then I found I was wrong, I counld list these
> commands with subcommand
> "list-commands _" and I counld execute this commands in the asadmin utility.
The "_" does mean "private" but private in the sense that the command is
not documented
and it may be removed or changed in any release, so don't depend on it
being there.
Generally, these commands are used by the implementation of other commands.
There is no special mean to the double underscore - it is just a private
command too.
There are no special access restrictions on private commands. As you
have seen,
list-commands will show them and they can be executed.
>
> Therefore, please tell me the difference between them,
> or do we have a convention about them?
>
> Moreover, can I define a command that its name contains a space, just
> like the following:
>
> @Service(name="add --cloud-container")
> @Scoped(PerLookup.class)
> public class AddCloudContainer implements AdminCommand {
>
> It's ok in my test, but I'm not sure whether there are
> poential problems like doing these.
No, this is not a good practice. If it works, it probably shouldn't.
Tom
>
> Thanks,
> Leisore
>
>