SlideShare a Scribd company logo
Deployment of EJB Middleware Technologies Unit – 3 ----------- Roy Antony Arnold G Lecturer Panimalar Engineering College Chennai, Tamilnadu, India
The Deployment Descriptor Class This is the base class used by both  SessionDescriptor  and the  EntityDescriptor  classes. This class is the main way in which information is communicated  from the EJB developer to the deployer and to the container  in which the bean will be deployed. The bean developer uses the “ setter ” methods of this class to initialize the various properties of this class, and the deployment environment uses the “ getter ” methods to read these values at deployment time. All currently available EJB tools provide GUI tools to allow the developer and/or deployer to generate DeploymentDescriptors and their associated classes via pointing and clicking.
DeploymentDescriptor Class public class javax.ejb.deployment.DeploymentDescriptor extends java.lang.Object implements java.io.Serializable { protected int versionNumber; public DeploymentDescriptor(); public AccessControlEntry[] getAccessControlEntries(); public AccessControlEntry getAccessControlEntries(int index); public Name getBeanHomeName(); public ControlDescriptor[] getControlDescriptors(); public ControlDescriptor getControlDescriptors(int index); public String getEnterpriseBeanClassName(); public properties getEnvironmentProperties(); public String getHomeInterfaceClassName(); public boolean getReentrant(); public String getRemoteInterfaceClassName(); public boolean isReentrant();
Contd… public void setAccessControlEntries(AccessControlEntry values[]); public void setAccessControlEntires(int index, AccessControlEntry value); public void setBeanHomeName(Name value); public void setControlDescriptors(ControlDescriptor value[]); public void setControlDescriptors(int index, ControlDescriptor value); public void setEnterpriseBeanClassName(String value); public void setEnvironmentProperties(Properties value); public void setHomeInterfaceClassName(String value); public void setReentrant(boolean value); public void setRemoteInterfaceClassName(String value); }
Contd… The deployment descriptor inherits from  java.lang.Object  and that it is serializable. Serialization  is important for deployment descriptors for shipping the final product and later for deployment of the bean. The EJB specification indicates that a container should provide support for versioning.  For example, if a new version of a bean is installed, an older version should also continue to run. The  version number  provides a mechanism for discriminating among otherwise-identical beans. The  getBeanHomeName()  method returns a  javax.naming.Name  object representing the name that the container should make available for clients that wish to use the bean. The container is responsible for placing this name into the JNDI namespace. Clients then use the JNDI  InitialContext.lookup()  method, with this name as the argument to find the bean’s home interface.
Contd… Environment properties carry the information such as the name of the JDBC driver and the name of the JDBC data source. Properties are useful for holding information that may be modified at deployment time.  (this resembles the *.ini files in windows) The  getReentrant()  method, which returns a Boolean value indicating whether the bean is reentrant. There are few important points about reentrancy: Only Entity beans can be reentrant; Session beans can never be reentrant. Reentrancy introduces the possibility of several sorts of concurrency-related problems.  Think twice before using it. Then think again. Then find another way to do it.
The AccessControlEntry Class An AccessControlEntry is another class in the  javax.ejb.deployment  package; the purpose of this class is to pair a given method in your bean with a list of identities. public class javax.ejb.deployment.AccessControlEntry extends java.lang.object implements java.io.serializable { public AccessControlEntry(); public AccessControlEntry(Method method); public AccessControlEntry(Method method, Identity identities[]); public Identity[] getAllowedIdentities(); public Identity getAllowedIdentities(int index); public Method getMethod(); public void setAllowedIdentities(Identity values[]); public void setAllowedIdentities(int index, Identity value); public void setMethod(Method value); }
Contd… Note that the class consists mainly of  getter   and  setter  methods (known as  accessor   and  mutator  methods) that allow you to associate a set of identities with a particular method. If you set up an access control entry for a given method, then only the accounts that correspond to the specified identities will be allowed to invoke that method. Typically, the Identity objects correspond to roles rather than to the identities of particular users.  At deployment time, the  EJB deployer  establishes  ACL  that relate sets of actual accounts to the roles provided in the deployment descriptor. If a user does not map to one of these identities, a  SecurityException  will be thrown, when he attempts to execute the method.
The ControlDescriptor Class public class javax.ejb.deployment.ControlDescriptor extends java.lang.Object implements java.io.Serializable { public final static int CLIENT_IDENTITY; public final static int SPECIFIED_IDENTITY; public final static int SYSTEM_IDENTITY; public final static int TRANSACTION_READ_COMMITTED; public final static int TRANSACTION_READ_UNCOMMITTED; public final static int TRANSACTION_REPEATABLE_READ; public final static int TRANSACTION_SERIALIZABLE; public final static int TX_BEAN_MANAGED; public final static int TX_MANDATORY; public final static int TX_NOT_SUPPORTED; public final static int TX_SUPPORTS; public final static int TX_REQUIRED; public final static int TX_REQUIRES_NEW;
Contd… public ControlDescriptor(); public ControlDescriptor(Method method); public int getIsolationLevel(); public Method getMethod(); public Identity getRunAsIdentity(); public int getRunAsMode(); public int getTrasactionAttribute(); public void setIsolationLevel(int value); public void setMethod(Method value); public void setRunAsIdentity(Identity value); public void setRunAsMode(int value); public void setTransactionAttribute(int value); } The ControlDescriptor has three concerns: The method’s transaction attribute The method’s isolation level The method’s “run-as” mode
“ Run-as” Modes “ Run-as” modes specify the identity that the bean should have at runtime.  It is important when you set up an access control scheme for your beans and need to call one bean from another.  The run-as mode specifies the type of identity that the calling bean should pass to the called bean. Three run-as modes exist: CLIENT_IDENTITY , which means that the bean will use the identity of the client as its own identity when it makes calls to other beans. SYSTEM_IDENTITY , which means that the bean will use the identity of a “system” account when invoking other beans. Generally, the bean deployer must configure this account in the container. SPECIFIED_IDENTITY ,  which means that the bean will use specific identity. This identity is found in the  RunAsIdentity  property, which is applicable only if the bean is using SPECIFIED_IDENTITY.
The SessionDescriptor Class public class javax.ejb.deployment.SessionDescriptor extends javax.ejb.deployment.DeploymentDescriptor { public final static int STATEFUL_SESSION; public final static int STATELESS_SESSION; public SessionDescriptor(); public int getSessionTimeout(); public int getStateManagementType(); public void setSessionTimeout(int value); public void setStateManagementType(int value); } The return value of the SessionTimeout property represents the number of seconds that a bean can be inactive before the container is allowed to destroy it.
The EntityDescriptor Class public class javax.ejb.deployment.EntityDescriptor extends javax.ejb.deployment.DeploymentDescriptor() { public EntityDescriptor(); public Field[] getContainerManagedFields(); public Field getContainerManagedFields (int index); public String getPrimaryKeyCassName(); public void setContainerManagedFields (Field values[]); public void setContainerManagedFields (int index, Field value); public void setPrimaryKeyClassName(String value); }
Using Roles at Runtime isCallerInRole()  can be used to allow a method to respond differently based on the role of the user who invokes it. When the method is invoked by a  normal user , the method could display information about the user’s account. When the method is invoked by a  super user ,  it might display information about all accounts. Following code can be written: Identity su = new MyIdentity(“superuser”); if (ctx.isCallerInRole(su)) { // return a list of all accounts } else { // return only the caller’s account info }
The DeploymentDescriptor Setting up ACL is a two-part process: When the bean is written,  AccessContolEntry  objects need to be established for the various categories of users that are allowed to access the methods. At deployment time, these categories of users must be mapped to actual users. To take care of the first part of this process, add the following code to the deployment descriptor (accessControlEntries DEFAULT [superusers myPeople] myProtectedMethod [superusers]); end accessControlEntries Only members of the  superusers  group will be allowed to access these methods. If a client who is not a member of one of these groups attempts to invoke one of the bean’s methods, a  SecurityException  will be thrown. When distributing your beans, you should  include a description of the roles supported.  This precaution will allow the deployer to make informed decisions about which users should be in which roles.
Setting up Access Control Lists In WebLogic, there are two ways of setting up ACLs: You can set them up in the  weblogic.properties  file. You can create an authentication database and set up your user identities there. Ex: for  weblogic.properties file  sets up the superusers & mypeople groups: weblogic.password.superuser1=superpassword1 weblogic.password.superuser2=superpassword2 weblogic.security.group.superusers=superuser1, superuser2 weblogic.password.myUser=myPassword weblogic.password.myUser2=myPassword2 weblogic.security.group.mypeople=myUser,myUser2 To create the user id WebLogic, use the following syntax weblogic.password.<userid>=<password> To create the group in Weblogic, use the following syntax weblogic.security.group.<groupname>=<userid1>,…<useridn)
Container-Managed Finder Methods Finder methods for container-managed Entity beans are created at deployment time, and that the  EJB specification does not mandate any particular format  that the bean developer must use to describe the finder methods to the bean deployer. An SQL-like syntax is probably the least ambiguous way to describe these finder methods. A sample SQL statement to implement: select * from accounts where date_today – date_due > $argument As a bean deployer, you should provide a full and complete description of exactly how to implement your finder methods, if you use container-managed entity beans.
Other Deployment Issues Caching Issues The number of Entity beans to maintain in the pool The number of instances of a session bean to allow before the container begins to passivate beans. A time interval after which inactive beans will be passivated by the container Consider implementation’s documentation for more inoformation on the configuration parameters available. Persistent Storage The container may require the deployer to create a particular database table to be used for persistent storage of Entity EJBs.  It also may require information about the mechanism employed to passivate stateful Session EJBs temporarily. Properties If environment properties must be set for the bean, the deployer should examine the properties and ensure that they are set correctly.
Other Deployment Issues – Other Administrative Issues Don’t Reboot Watch for Churning Adjust Timeout value of Session Bean Appropriately Monitor the Number of Aborted Transactions Watch for Security Exceptions Be Parsimonious with Permissions Be Parsimonious with Services Check for Default Accounts and Obsolete Accounts Know your System

More Related Content

PPT
EJB Clients
PPTX
Skillwise EJB3.0 training
PPTX
Introduction to JPA (JPA version 2.0)
PPT
Entity Persistence with JPA
PDF
Java persistence api 2.1
ODP
JPA Best Practices
ODP
Hibernate complete Training
PPTX
Java Beans
EJB Clients
Skillwise EJB3.0 training
Introduction to JPA (JPA version 2.0)
Entity Persistence with JPA
Java persistence api 2.1
JPA Best Practices
Hibernate complete Training
Java Beans

What's hot (20)

PPT
比XML更好用的Java Annotation
PPT
Session 4 Tp4
PDF
Introduction to JPA and Hibernate including examples
PDF
Java EE 與 雲端運算的展望
PPT
Session 3 Tp3
PPT
Java Persistence API (JPA) Step By Step
PPT
ODT
Types of Dependency Injection in Spring
PDF
Ejb examples
PPTX
JPA For Beginner's
PPTX
PPT
hibernate with JPA
PPTX
Enterprise Java Beans 3 - Business Logic
PPT
jpa-hibernate-presentation
PDF
EJB et WS (Montreal JUG - 12 mai 2011)
PPT
Session 6 Tp6
PPTX
Wiesław Kałkus: C# functional programming
PPT
Hibernate Tutorial
PPT
02 Hibernate Introduction
比XML更好用的Java Annotation
Session 4 Tp4
Introduction to JPA and Hibernate including examples
Java EE 與 雲端運算的展望
Session 3 Tp3
Java Persistence API (JPA) Step By Step
Types of Dependency Injection in Spring
Ejb examples
JPA For Beginner's
hibernate with JPA
Enterprise Java Beans 3 - Business Logic
jpa-hibernate-presentation
EJB et WS (Montreal JUG - 12 mai 2011)
Session 6 Tp6
Wiesław Kałkus: C# functional programming
Hibernate Tutorial
02 Hibernate Introduction
Ad

Viewers also liked (20)

PPT
C O R B A Unit 4
PPS
dot NET Framework
PPT
Interoperability
PPT
CORBA Basic and Deployment of CORBA
PPT
DCOM Comparison
PDF
EJB 3.1 by Bert Ertman
PDF
javabeans
PPT
COM Introduction
PPTX
Component object model and
PPT
Corba introduction and simple example
PDF
Common Object Request Broker Architecture - CORBA
PPTX
Javabeans
PPT
Distributed objects & components of corba
PPT
middleware
PPT
Java beans
PPTX
Corba concepts & corba architecture
PPTX
PPT
Middleware
C O R B A Unit 4
dot NET Framework
Interoperability
CORBA Basic and Deployment of CORBA
DCOM Comparison
EJB 3.1 by Bert Ertman
javabeans
COM Introduction
Component object model and
Corba introduction and simple example
Common Object Request Broker Architecture - CORBA
Javabeans
Distributed objects & components of corba
middleware
Java beans
Corba concepts & corba architecture
Middleware
Ad

Similar to Deployment (20)

PPT
Session 8 Tp8
PPT
ADVANCED JAVA MODULE I & II.ppt
PDF
Java EE Services
PDF
EJB 3.0 - Yet Another Introduction
PDF
EJB Interview Questions
PPT
CommercialSystemsBahman.ppt
PPTX
EJB3 Advance Features
PPT
J2EEFeb11.ppt
PPT
J2EEFeb11 (1).ppt
PPT
Session 5 Tp5
PPT
PDF
Enterprise Java Beans - EJB
PDF
Ejb - september 2006
PDF
17 wics99 harkey
PPT
Enterprise java beans(ejb) update 2
PPT
Enterprise java beans(ejb) Update 2
PPT
Unite5-EJB-2019.ppt
PPT
Enterprise Java Beans( E)
DOCX
Ecom lec3 16_ej_bs
PPT
Enterprise java beans(ejb)
Session 8 Tp8
ADVANCED JAVA MODULE I & II.ppt
Java EE Services
EJB 3.0 - Yet Another Introduction
EJB Interview Questions
CommercialSystemsBahman.ppt
EJB3 Advance Features
J2EEFeb11.ppt
J2EEFeb11 (1).ppt
Session 5 Tp5
Enterprise Java Beans - EJB
Ejb - september 2006
17 wics99 harkey
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) Update 2
Unite5-EJB-2019.ppt
Enterprise Java Beans( E)
Ecom lec3 16_ej_bs
Enterprise java beans(ejb)

More from Roy Antony Arnold G (20)

PDF
PDF
Reliability growth models for quality management
PDF
Quality management models
PDF
Pareto diagram
PDF
Ishikawa diagram
PDF
PDF
Customer satisfaction
PDF
Complexity metrics and models
PDF
Check lists
PDF
Capability maturity model
PDF
Structure chart
PDF
Seven new tools
PDF
Scatter diagram
PDF
Relations diagram
PDF
Rayleigh model
PDF
Defect removal effectiveness
PDF
Customer satisfaction
Reliability growth models for quality management
Quality management models
Pareto diagram
Ishikawa diagram
Customer satisfaction
Complexity metrics and models
Check lists
Capability maturity model
Structure chart
Seven new tools
Scatter diagram
Relations diagram
Rayleigh model
Defect removal effectiveness
Customer satisfaction

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Approach and Philosophy of On baking technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
20250228 LYD VKU AI Blended-Learning.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Approach and Philosophy of On baking technology
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Deployment

  • 1. Deployment of EJB Middleware Technologies Unit – 3 ----------- Roy Antony Arnold G Lecturer Panimalar Engineering College Chennai, Tamilnadu, India
  • 2. The Deployment Descriptor Class This is the base class used by both SessionDescriptor and the EntityDescriptor classes. This class is the main way in which information is communicated from the EJB developer to the deployer and to the container in which the bean will be deployed. The bean developer uses the “ setter ” methods of this class to initialize the various properties of this class, and the deployment environment uses the “ getter ” methods to read these values at deployment time. All currently available EJB tools provide GUI tools to allow the developer and/or deployer to generate DeploymentDescriptors and their associated classes via pointing and clicking.
  • 3. DeploymentDescriptor Class public class javax.ejb.deployment.DeploymentDescriptor extends java.lang.Object implements java.io.Serializable { protected int versionNumber; public DeploymentDescriptor(); public AccessControlEntry[] getAccessControlEntries(); public AccessControlEntry getAccessControlEntries(int index); public Name getBeanHomeName(); public ControlDescriptor[] getControlDescriptors(); public ControlDescriptor getControlDescriptors(int index); public String getEnterpriseBeanClassName(); public properties getEnvironmentProperties(); public String getHomeInterfaceClassName(); public boolean getReentrant(); public String getRemoteInterfaceClassName(); public boolean isReentrant();
  • 4. Contd… public void setAccessControlEntries(AccessControlEntry values[]); public void setAccessControlEntires(int index, AccessControlEntry value); public void setBeanHomeName(Name value); public void setControlDescriptors(ControlDescriptor value[]); public void setControlDescriptors(int index, ControlDescriptor value); public void setEnterpriseBeanClassName(String value); public void setEnvironmentProperties(Properties value); public void setHomeInterfaceClassName(String value); public void setReentrant(boolean value); public void setRemoteInterfaceClassName(String value); }
  • 5. Contd… The deployment descriptor inherits from java.lang.Object and that it is serializable. Serialization is important for deployment descriptors for shipping the final product and later for deployment of the bean. The EJB specification indicates that a container should provide support for versioning. For example, if a new version of a bean is installed, an older version should also continue to run. The version number provides a mechanism for discriminating among otherwise-identical beans. The getBeanHomeName() method returns a javax.naming.Name object representing the name that the container should make available for clients that wish to use the bean. The container is responsible for placing this name into the JNDI namespace. Clients then use the JNDI InitialContext.lookup() method, with this name as the argument to find the bean’s home interface.
  • 6. Contd… Environment properties carry the information such as the name of the JDBC driver and the name of the JDBC data source. Properties are useful for holding information that may be modified at deployment time. (this resembles the *.ini files in windows) The getReentrant() method, which returns a Boolean value indicating whether the bean is reentrant. There are few important points about reentrancy: Only Entity beans can be reentrant; Session beans can never be reentrant. Reentrancy introduces the possibility of several sorts of concurrency-related problems. Think twice before using it. Then think again. Then find another way to do it.
  • 7. The AccessControlEntry Class An AccessControlEntry is another class in the javax.ejb.deployment package; the purpose of this class is to pair a given method in your bean with a list of identities. public class javax.ejb.deployment.AccessControlEntry extends java.lang.object implements java.io.serializable { public AccessControlEntry(); public AccessControlEntry(Method method); public AccessControlEntry(Method method, Identity identities[]); public Identity[] getAllowedIdentities(); public Identity getAllowedIdentities(int index); public Method getMethod(); public void setAllowedIdentities(Identity values[]); public void setAllowedIdentities(int index, Identity value); public void setMethod(Method value); }
  • 8. Contd… Note that the class consists mainly of getter and setter methods (known as accessor and mutator methods) that allow you to associate a set of identities with a particular method. If you set up an access control entry for a given method, then only the accounts that correspond to the specified identities will be allowed to invoke that method. Typically, the Identity objects correspond to roles rather than to the identities of particular users. At deployment time, the EJB deployer establishes ACL that relate sets of actual accounts to the roles provided in the deployment descriptor. If a user does not map to one of these identities, a SecurityException will be thrown, when he attempts to execute the method.
  • 9. The ControlDescriptor Class public class javax.ejb.deployment.ControlDescriptor extends java.lang.Object implements java.io.Serializable { public final static int CLIENT_IDENTITY; public final static int SPECIFIED_IDENTITY; public final static int SYSTEM_IDENTITY; public final static int TRANSACTION_READ_COMMITTED; public final static int TRANSACTION_READ_UNCOMMITTED; public final static int TRANSACTION_REPEATABLE_READ; public final static int TRANSACTION_SERIALIZABLE; public final static int TX_BEAN_MANAGED; public final static int TX_MANDATORY; public final static int TX_NOT_SUPPORTED; public final static int TX_SUPPORTS; public final static int TX_REQUIRED; public final static int TX_REQUIRES_NEW;
  • 10. Contd… public ControlDescriptor(); public ControlDescriptor(Method method); public int getIsolationLevel(); public Method getMethod(); public Identity getRunAsIdentity(); public int getRunAsMode(); public int getTrasactionAttribute(); public void setIsolationLevel(int value); public void setMethod(Method value); public void setRunAsIdentity(Identity value); public void setRunAsMode(int value); public void setTransactionAttribute(int value); } The ControlDescriptor has three concerns: The method’s transaction attribute The method’s isolation level The method’s “run-as” mode
  • 11. “ Run-as” Modes “ Run-as” modes specify the identity that the bean should have at runtime. It is important when you set up an access control scheme for your beans and need to call one bean from another. The run-as mode specifies the type of identity that the calling bean should pass to the called bean. Three run-as modes exist: CLIENT_IDENTITY , which means that the bean will use the identity of the client as its own identity when it makes calls to other beans. SYSTEM_IDENTITY , which means that the bean will use the identity of a “system” account when invoking other beans. Generally, the bean deployer must configure this account in the container. SPECIFIED_IDENTITY , which means that the bean will use specific identity. This identity is found in the RunAsIdentity property, which is applicable only if the bean is using SPECIFIED_IDENTITY.
  • 12. The SessionDescriptor Class public class javax.ejb.deployment.SessionDescriptor extends javax.ejb.deployment.DeploymentDescriptor { public final static int STATEFUL_SESSION; public final static int STATELESS_SESSION; public SessionDescriptor(); public int getSessionTimeout(); public int getStateManagementType(); public void setSessionTimeout(int value); public void setStateManagementType(int value); } The return value of the SessionTimeout property represents the number of seconds that a bean can be inactive before the container is allowed to destroy it.
  • 13. The EntityDescriptor Class public class javax.ejb.deployment.EntityDescriptor extends javax.ejb.deployment.DeploymentDescriptor() { public EntityDescriptor(); public Field[] getContainerManagedFields(); public Field getContainerManagedFields (int index); public String getPrimaryKeyCassName(); public void setContainerManagedFields (Field values[]); public void setContainerManagedFields (int index, Field value); public void setPrimaryKeyClassName(String value); }
  • 14. Using Roles at Runtime isCallerInRole() can be used to allow a method to respond differently based on the role of the user who invokes it. When the method is invoked by a normal user , the method could display information about the user’s account. When the method is invoked by a super user , it might display information about all accounts. Following code can be written: Identity su = new MyIdentity(“superuser”); if (ctx.isCallerInRole(su)) { // return a list of all accounts } else { // return only the caller’s account info }
  • 15. The DeploymentDescriptor Setting up ACL is a two-part process: When the bean is written, AccessContolEntry objects need to be established for the various categories of users that are allowed to access the methods. At deployment time, these categories of users must be mapped to actual users. To take care of the first part of this process, add the following code to the deployment descriptor (accessControlEntries DEFAULT [superusers myPeople] myProtectedMethod [superusers]); end accessControlEntries Only members of the superusers group will be allowed to access these methods. If a client who is not a member of one of these groups attempts to invoke one of the bean’s methods, a SecurityException will be thrown. When distributing your beans, you should include a description of the roles supported. This precaution will allow the deployer to make informed decisions about which users should be in which roles.
  • 16. Setting up Access Control Lists In WebLogic, there are two ways of setting up ACLs: You can set them up in the weblogic.properties file. You can create an authentication database and set up your user identities there. Ex: for weblogic.properties file sets up the superusers & mypeople groups: weblogic.password.superuser1=superpassword1 weblogic.password.superuser2=superpassword2 weblogic.security.group.superusers=superuser1, superuser2 weblogic.password.myUser=myPassword weblogic.password.myUser2=myPassword2 weblogic.security.group.mypeople=myUser,myUser2 To create the user id WebLogic, use the following syntax weblogic.password.<userid>=<password> To create the group in Weblogic, use the following syntax weblogic.security.group.<groupname>=<userid1>,…<useridn)
  • 17. Container-Managed Finder Methods Finder methods for container-managed Entity beans are created at deployment time, and that the EJB specification does not mandate any particular format that the bean developer must use to describe the finder methods to the bean deployer. An SQL-like syntax is probably the least ambiguous way to describe these finder methods. A sample SQL statement to implement: select * from accounts where date_today – date_due > $argument As a bean deployer, you should provide a full and complete description of exactly how to implement your finder methods, if you use container-managed entity beans.
  • 18. Other Deployment Issues Caching Issues The number of Entity beans to maintain in the pool The number of instances of a session bean to allow before the container begins to passivate beans. A time interval after which inactive beans will be passivated by the container Consider implementation’s documentation for more inoformation on the configuration parameters available. Persistent Storage The container may require the deployer to create a particular database table to be used for persistent storage of Entity EJBs. It also may require information about the mechanism employed to passivate stateful Session EJBs temporarily. Properties If environment properties must be set for the bean, the deployer should examine the properties and ensure that they are set correctly.
  • 19. Other Deployment Issues – Other Administrative Issues Don’t Reboot Watch for Churning Adjust Timeout value of Session Bean Appropriately Monitor the Number of Aborted Transactions Watch for Security Exceptions Be Parsimonious with Permissions Be Parsimonious with Services Check for Default Accounts and Obsolete Accounts Know your System