com.microfocus.cobol
Class CobolBean

java.lang.Object
  extended bycom.microfocus.cobol.CobolBean

public class CobolBean
extends Object

Class contains methods for constructing a CobolBean

Copyright: Copyright (c) 2002-2003
Company: Micro Focus International Ltd

Since:
Net Express 4.0, Server Express 4.0
Version:
3.19, 4/8/03

Constructor Summary
CobolBean()
          Constructor for a CobolBean

Usage:
 
Method Summary
protected static byte[] allocContext()
          Method declaration
protected static int attachContext(byte[] attachKey)
          attachContext
protected  void attachToThread()
          Method declaration
 void cancel()
          Performs a cancel on any COBOL programs used with in this bean.
 int cobcall(String program)
          Calls a COBOL program with no parameters, return-code is returned as a int.
 int cobcall(String program, ParameterList parameters)
          Calls a COBOL program with a ParameterList and returns return-code as a int.
 long cobload(String program)
          Preload a cobol program without calling the program-id.
 int cobrcall(String program)
          Calls a COBOL program with no parameters which returns the return-code as a int
NB: This method allows the user to call unchanged COBOL programs.
 int cobrcall(String program, ParameterList parameters)
          Calls a COBOL program with a set of parameters which returns the return-code as a int

NB: This method allows the user to call unchanged COBOL programs.
protected static int createContext(byte[] attachKey)
          createContext
protected static int destroyContext(byte[] detatchKey)
          Method declaration
protected static int detatchContext(byte[] detatchKey)
          detachContext
 void dispose()
          Dispose this instance of a CobolBean.
protected static void dumpBytes(byte[] bytes)
          Method declaration
protected static int freeContext(byte[] getKey)
          Method declaration
protected static int getContext(byte[] getKey)
          Method declaration
protected static int getKeySize()
          getKeySize get size of context (size of void *)
 void setBeanIsInitial(boolean beanInitial)
          Sets the "Is initial" state of any programs called from a instance of a COBOL Bean.

When set to true, it ensures that the COBOL program being "cob[r]call"'ed is always in it's initial state.
protected static int setContext(byte[] setKey)
          setContext
protected  void throwExceptionIfStatusCodeFailed()
          Method declaration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CobolBean

public CobolBean()
          throws CobolException,
                 Exception
Constructor for a CobolBean

Usage:
 public myCobolBean extends com.microfocus.cobol.CobolBean
 {
 public myCobolBean()
 {
 super();  // ensure parent constructor is invoked.
 }

 public void setName(String name) throws CobolException, Exception
 {
 super.cobcall("setName", new ParameterList().add(name));
 }

 }
 

Throws:
CobolException
Exception
Method Detail

attachToThread

protected void attachToThread()
                       throws Exception
Method declaration

Throws:
Exception

setBeanIsInitial

public void setBeanIsInitial(boolean beanInitial)
Sets the "Is initial" state of any programs called from a instance of a COBOL Bean.

When set to true, it ensures that the COBOL program being "cob[r]call"'ed is always in it's initial state.

Parameters:
beanInitial - required "is initial" state

cobcall

public int cobcall(String program)
            throws CobolException,
                   Exception
Calls a COBOL program with no parameters, return-code is returned as a int.

Parameters:
program -
Returns:
a int RETURN-CODE
Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

throwExceptionIfStatusCodeFailed

protected void throwExceptionIfStatusCodeFailed()
                                         throws CobolException
Method declaration

Throws:
CobolException

cobcall

public int cobcall(String program,
                   ParameterList parameters)
            throws CobolException,
                   Exception
Calls a COBOL program with a ParameterList and returns return-code as a int.

Parameters:
program -
parameters -
Returns:
a int RETURN-CODE
Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

cancel

public void cancel()
            throws CobolException,
                   Exception
Performs a cancel on any COBOL programs used with in this bean.

Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

cobrcall

public int cobrcall(String program)
             throws CobolException,
                    Exception
Calls a COBOL program with no parameters which returns the return-code as a int
NB: This method allows the user to call unchanged COBOL programs.

The invoker of method should ensure that String, StringBuffer objects are of the same size as defined in the interface (linkage section) to the COBOL program.

Parameters:
program -
Returns:
a int RETURN-CODE
Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

cobrcall

public int cobrcall(String program,
                    ParameterList parameters)
             throws CobolException,
                    Exception
Calls a COBOL program with a set of parameters which returns the return-code as a int

NB: This method allows the user to call unchanged COBOL programs.

The invoker of method should ensure that String, StringBuffer objects are of the same size as defined in the interface (linkage section) to the COBOL program.

Parameters:
program -
parameters -
Returns:
a int RETURN-CODE
Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

cobload

public long cobload(String program)
             throws CobolException,
                    Exception
Preload a cobol program without calling the program-id.

Parameters:
program - name of COBOL program
Returns:
long return-code
Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

dispose

public void dispose()
             throws CobolException,
                    Exception
Dispose this instance of a CobolBean.

Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

allocContext

protected static byte[] allocContext()
                              throws CobolException,
                                     Exception
Method declaration

Returns:
byte[] containing a pointer to a context
Throws:
CobolException - - COBOL Exception
Exception - - NON COBOL Exception

dumpBytes

protected static void dumpBytes(byte[] bytes)
Method declaration

Parameters:
bytes -

getKeySize

protected static int getKeySize()
                         throws CobolException,
                                Exception
getKeySize get size of context (size of void *)

Returns:
a int RETURN-CODE
Throws:
CobolException
Exception

createContext

protected static int createContext(byte[] attachKey)
                            throws CobolException,
                                   Exception
createContext

Parameters:
attachKey -
Returns:
a int RETURN-CODE
Throws:
CobolException
Exception

attachContext

protected static int attachContext(byte[] attachKey)
                            throws CobolException,
                                   Exception
attachContext

Parameters:
attachKey -
Returns:
a int RETURN-CODE
Throws:
CobolException
Exception

detatchContext

protected static int detatchContext(byte[] detatchKey)
                             throws CobolException,
                                    Exception
detachContext

Parameters:
detatchKey -
Returns:
a integer return-code
Throws:
CobolException
Exception

destroyContext

protected static int destroyContext(byte[] detatchKey)
                             throws CobolException,
                                    Exception
Method declaration

Parameters:
detatchKey -
Returns:
int return-code
Throws:
CobolException
Exception

setContext

protected static int setContext(byte[] setKey)
                         throws CobolException,
                                Exception
setContext

Parameters:
setKey -
Returns:
a integer return-code
Throws:
CobolException
Exception

getContext

protected static int getContext(byte[] getKey)
                         throws CobolException,
                                Exception
Method declaration

Parameters:
getKey -
Returns:
a int RETURN-CODE
Throws:
CobolException
Exception

freeContext

protected static int freeContext(byte[] getKey)
                          throws CobolException,
                                 Exception
Method declaration

Parameters:
getKey -
Returns:
a int RETURN-CODE
Throws:
CobolException
Exception



Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.