Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mobicents.slee.container.deployment
Class SbbAbstractDecorator  view SbbAbstractDecorator download SbbAbstractDecorator.java

java.lang.Object
  extended byorg.mobicents.slee.container.deployment.SbbAbstractDecorator

public class SbbAbstractDecorator
extends java.lang.Object

Class decorating the sbb abstract class. The byte code is modified IF necessary to trap SBB code that violates the SLEE 1.0 spec:

 	1) write access to java:comp/env 
  2) new Thread()
 
TODO: Currently we check the SBB abstract class itself, but not its ascendands or utility classes it uses.


Field Summary
private  java.util.Map concreteMethods
          the sbb concrete methods written by the SBB developer
private  java.lang.String deployPath
          The path where DU classes will reside
private  boolean isAbstractSbbClassDecorated
          Optimization variable.
private static org.jboss.logging.Logger logger
          Logger to logg information
private  ClassPool pool
          Pool to generate or read classes with javassist
private  CtClass sbbAbstractClass
          the sbb abstract class
private  org.mobicents.slee.container.management.SbbDescriptorImpl sbbDeploymentDescriptor
          the sbb deployment descriptor
 
Constructor Summary
SbbAbstractDecorator(org.mobicents.slee.container.management.SbbDescriptorImpl sbbDeploymentDescriptor)
          Constructor
 
Method Summary
 void decorateAbstractSbb()
          Decorate the abstract sbb Class
private  void decorateENCBindCalls()
          If there are bind calls to ENC, replace with OperationNotSupportedException exception.
private  void decorateNewThreadCalls()
          If there are new Thread() calls, replace with exception.
private  void trapMethodIfENCBindCall(CtMethod method)
           
private  void writeDecoratedAbstractClassToDisc()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sbbDeploymentDescriptor

private org.mobicents.slee.container.management.SbbDescriptorImpl sbbDeploymentDescriptor
the sbb deployment descriptor


sbbAbstractClass

private CtClass sbbAbstractClass
the sbb abstract class


logger

private static org.jboss.logging.Logger logger
Logger to logg information


concreteMethods

private java.util.Map concreteMethods
the sbb concrete methods written by the SBB developer


pool

private ClassPool pool
Pool to generate or read classes with javassist


deployPath

private java.lang.String deployPath
The path where DU classes will reside


isAbstractSbbClassDecorated

private boolean isAbstractSbbClassDecorated
Optimization variable. Helps avoid writing to disk abstract classes, which are not modified.

Constructor Detail

SbbAbstractDecorator

public SbbAbstractDecorator(org.mobicents.slee.container.management.SbbDescriptorImpl sbbDeploymentDescriptor)
Constructor

Method Detail

decorateAbstractSbb

public void decorateAbstractSbb()
                         throws DeploymentException
Decorate the abstract sbb Class


writeDecoratedAbstractClassToDisc

private void writeDecoratedAbstractClassToDisc()
                                        throws DeploymentException

decorateNewThreadCalls

private void decorateNewThreadCalls()
If there are new Thread() calls, replace with exception. Required by SLEE 1.0 spec.


decorateENCBindCalls

private void decorateENCBindCalls()
If there are bind calls to ENC, replace with OperationNotSupportedException exception. Required by SLEE 1.0 spec.


trapMethodIfENCBindCall

private void trapMethodIfENCBindCall(CtMethod method)
                              throws CannotCompileException