tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-2060) EJB component can modify its naming context
Date Fri, 16 Jun 2017 08:13:00 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-2060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051569#comment-16051569
] 

ASF GitHub Bot commented on TOMEE-2060:
---------------------------------------

Github user rmannibucau commented on a diff in the pull request:

    https://github.com/apache/tomee/pull/72#discussion_r122386677
  
    --- Diff: container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
---
    @@ -477,9 +489,36 @@ public String getNameInNamespace() throws NamingException {
         public void close() throws NamingException {
         }
     
    -    protected void checkReadOnly() throws OperationNotSupportedException {
    +    //TODO: rename? isReadOnly?
    +    /*
    +     * return false if current naming context is not marked as read only
    +     * return true if current naming context is marked as read only and system property
jndiExceptionOnFailedWrite is set to false
    +     * 
    +     * throws OperationNotSupportedException if naming context:
    +     *   - is marked as read only and
    +     *   - system property jndiExceptionOnFailedWrite is set to true
    +     *   
    +     * jndiExceptionOnFailedWrite property is defined by tomcat and is used in similar
context for web app components
    +     * https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#jndiExceptionOnFailedWrite
    +     * 
    +     */
    +    protected boolean checkReadOnly() throws OperationNotSupportedException {
    +      //TODO: should it log?
             if (readOnly) {
    -            throw new OperationNotSupportedException();
    +            //alignment with tomcat behavior
    +            if("true".equals(System.getProperty("jndiExceptionOnFailedWrite"))) {
    +                throw new OperationNotSupportedException();
    +            }
    +            return true;
    +        }
    +        return false;
    +    }
    +    
    +    public void setReadOnly(boolean isReadOnly) {
    +        //TODO: should it log?
    --- End diff --
    
    no need to log it until there is an issue with this being called (which is more in write
methods)


> EJB component can modify its naming context
> -------------------------------------------
>
>                 Key: TOMEE-2060
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2060
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 7.0.3
>            Reporter: Katya Todorova
>
> According to the Java EE specification (6/7) EE.5.3.4:
> The container must ensure that the application component instances have only
> read access to their naming context. The container must throw the
> javax.naming.OperationNotSupportedException from all the methods of the
> javax.naming.Context interface that modify the environment naming context
> and its subcontexts.
> It seems that IvmContext checks if the naming context is read-only and throws the corresponding
exception but the flag is false by default and is never changed.
> Is this done on purpose or is this a todo functionality?  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message