Project JXTA

net.jxta.impl.shell.bin.chpgrp
Class chpgrp

java.lang.Object
  |
  +--net.jxta.impl.shell.ShellApp
        |
        +--net.jxta.impl.shell.bin.chpgrp.chpgrp

public class chpgrp
extends ShellApp

This command changes the ShellObject associated with stdgroup to a new PeerGroup. This is only meaningful, if the shell user has already joined the group. The join operation itself cahnges the value of stdgroup. However, since the shell user may want to join more than one group, the chpgrp command can use to reflect the peer group to/from which data are currently piped


Fields inherited from class net.jxta.impl.shell.ShellApp
adv, appMiscError, appNoError, appParamError, appSpawned, consin, consout, currentcmdline, dependsOn, group, inputPipe, outputPipe, pipes, returnVar, started, stopped
 
Constructor Summary
chpgrp()
          Constructor - allows to instanciate this class with no parameters
 
Method Summary
 void help()
          Prints out a man type help message
 int startApp(java.lang.String[] args)
          Start the application and write the output to the appropriate OutputPipe.
 void stopApp()
          Stops the application - does nothing.
 
Methods inherited from class net.jxta.impl.shell.ShellApp
consPollInput, consprint, consprintln, consWaitForInput, getAdvertisement, getEnv, getGroup, getInputConsPipe, getInputPipe, getOutputConsPipe, getOutputPipe, getReturnVariable, init, isRootShell, pollInput, print, println, setAdvertisement, setEnv, setGroup, setInputConsPipe, setInputPipe, setOutputConsPipe, setOutputPipe, setReturnVariable, waitForInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

chpgrp

public chpgrp()
Constructor - allows to instanciate this class with no parameters
Method Detail

startApp

public int startApp(java.lang.String[] args)
Start the application and write the output to the appropriate OutputPipe. We expect one command line argument: the name of the group to join.

The complete environment variable name is PG#<name> if the group was no yet joined and PG@<name> otherwise. The only time we want to change stdgroup is if the group was joined but is not currently stored in stdgroup.

Overrides:
startApp in class ShellApp
Parameters:
args - the command line arguments. In our case the length of the array should be 1 and the value at index 0 should be the name of the group to save into stdgroup

stopApp

public void stopApp()
Stops the application - does nothing.
Overrides:
stopApp in class ShellApp

help

public void help()
Prints out a man type help message
Overrides:
help in class ShellApp

Project JXTA