shady.common.op
Class Stop

java.lang.Object
  extended by shady.common.op.Operation
      extended by shady.common.op.BoundOperation
          extended by shady.common.op.Stop

public class Stop
extends BoundOperation

A Shady ShadyCommonAPI.stop(boolean) Operation.

Copyright (C) 2006 Marsette A. Vona, III

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Author:
Marsette (Marty) A. Vona, III

Field Summary
private static java.lang.String cvsid
          CVS id.
 boolean estop
          Whether this is an emergency stop.
 
Fields inherited from class shady.common.op.BoundOperation
shady
 
Constructor Summary
Stop(ShadyCommonAPI shady, boolean estop)
          Make a new Stop Operation.
 
Method Summary
 int exec()
          Execute the operation.
 java.lang.String toString()
          Get a human-readable description of this Operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cvsid

private static final java.lang.String cvsid

CVS id.

See Also:
Constant Field Values

estop

public boolean estop

Whether this is an emergency stop.

Constructor Detail

Stop

public Stop(ShadyCommonAPI shady,
            boolean estop)

Make a new Stop Operation.

Parameters:
shady - The Shady instance on which we operate
estop - whether this is an emergency stop
Method Detail

exec

public int exec()

Execute the operation.

Has no effect if the system is already in the target state of the operation.

Fails fast if the system is currently in fault.

Blocks until the operation is complete.

This impl executes on BoundOperation.shady.

Specified by:
exec in class BoundOperation
Returns:
0 if the operation was successful, otherwise the fault that occurred

toString

public java.lang.String toString()

Get a human-readable description of this Operation.

Overrides:
toString in class java.lang.Object
Returns:
a human-readable description of this Operation