uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

2.6.2 Application Scopes of Service Components That Use SessionBean

This subsection describes the application scope of service components that use SessionBean.

Organization of this subsection
(1) Prerequisite specifications
(2) Deployment destination of the available service component
(3) SessionBean creation conditions
(4) Schema format

(1) Prerequisite specifications

Service components that use SessionBean must be created according to the EJB 2.0 specifications.

(2) Deployment destination of the available service component

Only service components deployed on Cosminexus can be used as service components that use SessionBean.

(3) SessionBean creation conditions

Service components that use SessionBean must be created according to the following conditions:

Classes that can be specified for the arguments and return values
The classes to be specified for the arguments and return values of service components that use SessionBean must satisfy the following conditions:
  • A user-defined class must consist of the basic class.
  • The user-defined class specified for an argument or return value must have a private field and a public access method (setXX and getXX) for allowing access to that field from outside (JavaBeans format).
  • A user-defined interface class must not be specified for an argument or return value of a method that is public.
  • A user-defined abstract class must not be specified for an argument or return value of a method that is public.
  • A user-defined class that inherits a class other than java.lang.Object must not be specified for an argument or return value of a method that is public.
  • A user-defined class of a different package must not be specified for an argument or return value of a method that is public.
  • The following table shows the Java data types that can be used as an argument or return value of a method. Only those data types that are shown as usable in a given mode can be used.

    Table 2-13 Java data type usability

    Data type in Java Usability as an argument or return value of a method
    When used directly When used as an array When used as a member variable of a user-defined data class
    boolean Y Y Y
    javax.xml.rpc.holders.BooleanHolder Y -- --
    byte Y Y Y
    javax.xml.rpc.holders.ByteHolder Y -- --
    byte[] Y Y Y
    javax.xml.rpc.holders.ByteArrayHolder Y -- --
    double Y Y Y
    javax.xml.rpc.holders.DoubleHolder Y -- --
    float Y Y Y
    javax.xml.rpc.holders.FloatHolder Y -- --
    int Y Y Y
    javax.xml.rpc.holders.IntHolder Y -- --
    long Y Y Y
    javax.xml.rpc.holders.LongHolder Y -- --
    short Y Y Y
    javax.xml.rpc.holders.ShortHolder Y -- --
    java.lang.Byte Y Y Y
    javax.xml.rpc.holders.ByteWrapperHolder Y -- --
    java.lang.Byte[] Y Y Y
    java.lang.Double Y Y Y
    javax.xml.rpc.holders.DoubleWrapperHolder Y -- --
    java.lang.Float Y Y Y
    javax.xml.rpc.holders.FloatWrapperHolder Y -- --
    java.lang.Integer Y Y Y
    javax.xml.rpc.holders.IntegerWrapperHolder Y -- --
    java.lang.Long Y Y Y
    javax.xml.rpc.holders.LongWrapperHolder Y -- --
    java.lang.Object -- -- --
    javax.xml.rpc.holders.ObjectHolder -- -- --
    java.lang.Object[] -- -- --
    java.lang.Short Y Y Y
    javax.xml.rpc.holders.ShortWrapperHolder Y -- --
    java.lang.String Y Y Y
    javax.xml.rpc.holders.StringHolder Y -- --
    java.math.BigDecimal Y Y Y
    javax.xml.rpc.holders.BigDecimalHolder Y -- --
    java.math.BigInteger Y Y Y
    javax.xml.rpc.holders.BigIntegerHolder Y -- --
    java.util.Date Y Y Y
    javax.xml.namespace.QName Y Y Y
    javax.xml.rpc.holders.QNameHolder Y -- --
    java.lang.Boolean Y Y Y
    javax.xml.rpc.holders.BooleanWrapperHolder Y -- --
    java.util.Calendar Y Y Y
    javax.xml.rpc.holders.CalendarHolder Y -- --

    Legend:
    Y: Can be used.
    --: Cannot be used.

Method overload
Methods having the same name cannot be specified for service components that use SessionBean.

Transactions
Set the transaction attribute (trans-attribute) to be assigned to the transaction control type (transaction-type) and method of SessionBean so that it does not inherit transactions from the HCSC server. Transactions cannot be inherited by service components that use SessionBean.
The following table shows whether the transaction attribute can be specified for the service component transaction modes.

Table 2-14 Specification of the transaction attribute in service components

Transaction mode of the service component Tx attribute Usability
BMT N/A Y
CMT Required --
RequiresNew Y
Supports --
NotSupported Y
Mandatory --
Never --

Legend:
Y: Can be used (works according to the EJB specifications).
--: Cannot be used.
N/A: Not applicable

Method exceptions
Classes inherited from java.rmi.RemoteException and java.lang.RuntimeException are the only exceptions that can be described in the throws clause of a method.

SessionBean type
The SessionBean service component must be created as Stateless Session Bean.
In the execution environment of a Cosminexus Service Platform, connection (create) and disconnection (remove) are issued for each execution request to the EJB service. Therefore, service components that maintain an internal state by using Stateful Session Bean cannot be used.

(4) Schema format

The schema used in a service component in which SessionBean is used must satisfy the conditions explained in 2.6.5 Scoping of XML schema. For details on schema conditions, see "2.6.5 Scoping of XML schema".