From commits-returnshane48@example.com Sat Mar 04 05:24:27 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 39108 invoked from network); 4 Mar 2006 05:24:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Mar 2006 05:24:27 -0000 Received: (qmail 68924 invoked by uid 500); 4 Mar 2006 05:25:13 -0000 Delivered-To: shane48@example.com Received: (qmail 68880 invoked by uid 500); 4 Mar 2006 05:25:12 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 68869 invoked by uid 99); 4 Mar 2006 05:25:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Mar 2006 21:25:12 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 03 Mar 2006 21:25:11 -0800 Received: (qmail 39030 invoked by uid 65534); 4 Mar 2006 05:24:04 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383039 - in /directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support: DatagramAcceptorDelegate.java DatagramConnectorDelegate.java DatagramSessionImpl.java SocketSessionImpl.java Date: Sat, 04 Mar 2006 05:24:03 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: trustin Date: Fri Mar 3 21:23:58 2006 New Revision: 383039 URL: http://svn.apache.org/viewcvs?rev=383039&view=rev Log: Fixed issue: DIRMINA-180 (StreamWriteFilterTest.testWriteUsingSocketTransport fails on OS X) * Applied Peter's patch: setTrafficClass is called only when a new value is specified to work around the MacOS X issue. Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java?rev=383039&r1=383038&r2=383039&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java Fri Mar 3 21:23:58 2006 @@ -544,8 +544,12 @@ ch.socket().setBroadcast( cfg.isBroadcast() ); ch.socket().setReceiveBufferSize( cfg.getReceiveBufferSize() ); ch.socket().setSendBufferSize( cfg.getSendBufferSize() ); - ch.socket().setTrafficClass( cfg.getTrafficClass() ); - + + if( ch.socket().getTrafficClass() != cfg.getTrafficClass() ) + { + ch.socket().setTrafficClass( cfg.getTrafficClass() ); + } + ch.configureBlocking( false ); ch.socket().bind( req.address ); ch.register( selector, SelectionKey.OP_READ, req ); Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java?rev=383039&r1=383038&r2=383039&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java Fri Mar 3 21:23:58 2006 @@ -114,7 +114,11 @@ ch.socket().setBroadcast( cfg.isBroadcast() ); ch.socket().setReceiveBufferSize( cfg.getReceiveBufferSize() ); ch.socket().setSendBufferSize( cfg.getSendBufferSize() ); - ch.socket().setTrafficClass( cfg.getTrafficClass() ); + + if( ch.socket().getTrafficClass() != cfg.getTrafficClass() ) + { + ch.socket().setTrafficClass( cfg.getTrafficClass() ); + } if( localAddress != null ) { Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java?rev=383039&r1=383038&r2=383039&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java Fri Mar 3 21:23:58 2006 @@ -86,7 +86,11 @@ this.readBufferSize = cfg.getReceiveBufferSize(); this.config.setReuseAddress( cfg.isReuseAddress() ); this.config.setSendBufferSize( cfg.getSendBufferSize() ); - this.config.setTrafficClass( cfg.getTrafficClass() ); + + if( this.config.getTrafficClass() != cfg.getTrafficClass() ) + { + this.config.setTrafficClass( cfg.getTrafficClass() ); + } } } Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java?rev=383039&r1=383038&r2=383039&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java Fri Mar 3 21:23:58 2006 @@ -92,7 +92,11 @@ this.config.setSendBufferSize( cfg.getSendBufferSize() ); this.config.setSoLinger( cfg.getSoLinger() ); this.config.setTcpNoDelay( cfg.isTcpNoDelay() ); - this.config.setTrafficClass( cfg.getTrafficClass() ); + + if( this.config.getTrafficClass() != cfg.getTrafficClass() ) + { + this.config.setTrafficClass( cfg.getTrafficClass() ); + } } } From commits-returnshane48@example.com Mon Mar 06 21:09:23 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 71989 invoked from network); 6 Mar 2006 21:09:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Mar 2006 21:09:23 -0000 Received: (qmail 84895 invoked by uid 500); 6 Mar 2006 21:09:22 -0000 Delivered-To: shane48@example.com Received: (qmail 84843 invoked by uid 500); 6 Mar 2006 21:09:22 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 84832 invoked by uid 99); 6 Mar 2006 21:09:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 13:09:21 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Mar 2006 13:09:21 -0800 Received: (qmail 71828 invoked by uid 65534); 6 Mar 2006 21:09:00 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383671 - /directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/IoFilterLifeCycleManager.java Date: Mon, 06 Mar 2006 21:09:00 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: niklas Date: Mon Mar 6 13:08:57 2006 New Revision: 383671 URL: http://svn.apache.org/viewcvs?rev=383671&view=rev Log: Reverted back to the version before the first attempt for a fix for DIRMINA-169. Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/IoFilterLifeCycleManager.java Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/IoFilterLifeCycleManager.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/IoFilterLifeCycleManager.java?rev=383671&r1=383670&r2=383671&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/IoFilterLifeCycleManager.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/IoFilterLifeCycleManager.java Mon Mar 6 13:08:57 2006 @@ -47,23 +47,13 @@ { } - public void callInitIfNecessary( IoFilter filter ) + public synchronized void callInitIfNecessary( IoFilter filter ) { - boolean callInit = false; - - synchronized( this ) - { - ReferenceCount count = ( ReferenceCount ) counts.get( filter ); - if( count == null ) - { - count = new ReferenceCount(); - counts.put( filter, count ); - callInit = true; - } - } - - if( callInit ) + ReferenceCount count = ( ReferenceCount ) counts.get( filter ); + if( count == null ) { + count = new ReferenceCount(); + counts.put( filter, count ); try { filter.init(); @@ -76,19 +66,16 @@ } } - public void callOnPreAdd( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) + public synchronized void callOnPreAdd( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) { - synchronized( this ) + ReferenceCount count = ( ReferenceCount ) counts.get( filter ); + if( count == null ) { - ReferenceCount count = ( ReferenceCount ) counts.get( filter ); - if( count == null ) - { - throw new IllegalStateException(); - } - - count.increase(); + throw new IllegalStateException(); } + count.increase(); + try { filter.onPreAdd( chain, name, nextFilter ); @@ -101,20 +88,17 @@ } } - public void callOnPreRemove( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) + public synchronized void callOnPreRemove( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) { - synchronized( this ) + ReferenceCount count = ( ReferenceCount ) counts.get( filter ); + if( count == null || count.get() == 0 ) { - ReferenceCount count = ( ReferenceCount ) counts.get( filter ); - if( count == null || count.get() == 0 ) - { - return; - } + return; } try { - filter.onPreRemove( chain, name, nextFilter ); + filter.onPreRemove( chain, name, nextFilter); } catch( Throwable t ) { @@ -124,15 +108,12 @@ } } - public void callOnPostAdd( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) + public synchronized void callOnPostAdd( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) { - synchronized( this ) + ReferenceCount count = ( ReferenceCount ) counts.get( filter ); + if( count == null ) { - ReferenceCount count = ( ReferenceCount ) counts.get( filter ); - if( count == null ) - { - throw new IllegalStateException(); - } + throw new IllegalStateException(); } try @@ -142,7 +123,7 @@ catch( Throwable t ) { // Revert back the reference count. - decreaseCountSafely( filter ); + count.decrease(); throw new IoFilterLifeCycleException( "onPostAdd(): " + name + ':' + filter + " in " + @@ -150,15 +131,12 @@ } } - public void callOnPostRemove( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) + public synchronized void callOnPostRemove( IoFilterChain chain, String name, IoFilter filter, NextFilter nextFilter ) { - synchronized( this ) + ReferenceCount count = ( ReferenceCount ) counts.get( filter ); + if( count == null || count.get() == 0 ) { - ReferenceCount count = ( ReferenceCount ) counts.get( filter ); - if( count == null || count.get() == 0 ) - { - return; - } + return; } try @@ -173,42 +151,21 @@ } finally { - decreaseCountSafely( filter ); + count.decrease(); } } - private synchronized void decreaseCountSafely( IoFilter filter ) + public synchronized void callDestroyIfNecessary( IoFilter filter ) { ReferenceCount count = ( ReferenceCount ) counts.get( filter ); if( count == null ) { - throw new IllegalStateException(); + return; } - count.decrease(); - } - - public void callDestroyIfNecessary( IoFilter filter ) - { - boolean callDestroy = false; - - synchronized( this ) - { - ReferenceCount count = ( ReferenceCount ) counts.get( filter ); - if( count == null ) - { - return; - } - - if( count.get() == 0 ) - { - counts.remove( filter ); - callDestroy = true; - } - } - - if( callDestroy ) + if( count.get() == 0 ) { + counts.remove( filter ); try { filter.destroy(); From commits-returnshane48@example.com Mon Mar 06 21:12:43 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 74324 invoked from network); 6 Mar 2006 21:12:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Mar 2006 21:12:42 -0000 Received: (qmail 91833 invoked by uid 500); 6 Mar 2006 21:12:42 -0000 Delivered-To: shane48@example.com Received: (qmail 91778 invoked by uid 500); 6 Mar 2006 21:12:41 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 91767 invoked by uid 99); 6 Mar 2006 21:12:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 13:12:41 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Mar 2006 13:12:41 -0800 Received: (qmail 74244 invoked by uid 65534); 6 Mar 2006 21:12:20 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383673 - /directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Date: Mon, 06 Mar 2006 21:12:20 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: niklas Date: Mon Mar 6 13:12:17 2006 New Revision: 383673 URL: http://svn.apache.org/viewcvs?rev=383673&view=rev Log: Changed to way this filter is initialized and destroyed to fix DIRMINA-169. init() was renamed to start() and destroy() to stop(). These methods will not be called by MINA's IoFilter life cycle management. They will have to be called manually by the user. Alternatively, start() will be called automatically the first time an instance of this filter is added to a chain. All Worker threads are now set as dameons which means that any workers still alive when the JVM terminates will silently die. Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java?rev=383673&r1=383672&r2=383673&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Mon Mar 6 13:12:17 2006 @@ -28,6 +28,7 @@ import org.apache.mina.common.CloseFuture; import org.apache.mina.common.IdleStatus; import org.apache.mina.common.IoFilterAdapter; +import org.apache.mina.common.IoFilterChain; import org.apache.mina.common.IoHandler; import org.apache.mina.common.IoSession; import org.apache.mina.util.BlockingQueue; @@ -170,7 +171,16 @@ this.keepAliveTime = keepAliveTime; } - public void init() + public void onPreAdd( IoFilterChain parent, String name, NextFilter nextFilter ) + throws Exception + { + if( leader == null ) + { + start(); + } + } + + public void start() { shuttingDown = false; leader = new Worker(); @@ -178,7 +188,7 @@ leader.lead(); } - public void destroy() + public void stop() { shuttingDown = true; int expectedPoolSize = 0; @@ -340,6 +350,7 @@ this.id = id; this.setName( threadNamePrefix + '-' + id ); increasePoolSize( this ); + setDaemon( true ); } public boolean lead() From commits-returnshane48@example.com Mon Mar 06 21:13:49 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 74941 invoked from network); 6 Mar 2006 21:13:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Mar 2006 21:13:47 -0000 Received: (qmail 93370 invoked by uid 500); 6 Mar 2006 21:13:46 -0000 Delivered-To: shane48@example.com Received: (qmail 93337 invoked by uid 500); 6 Mar 2006 21:13:46 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 93326 invoked by uid 99); 6 Mar 2006 21:13:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 13:13:46 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Mar 2006 13:13:45 -0800 Received: (qmail 74604 invoked by uid 65534); 6 Mar 2006 21:13:24 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383675 - /directory/trunks/mina/core/src/test/java/org/apache/mina/filter/StreamWriteFilterTest.java Date: Mon, 06 Mar 2006 21:13:23 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: niklas Date: Mon Mar 6 13:13:20 2006 New Revision: 383675 URL: http://svn.apache.org/viewcvs?rev=383675&view=rev Log: The testWriteUsingSocketTransport test will now call start() and stop() on the ThreadPoolFilter is uses. Modified: directory/trunks/mina/core/src/test/java/org/apache/mina/filter/StreamWriteFilterTest.java Modified: directory/trunks/mina/core/src/test/java/org/apache/mina/filter/StreamWriteFilterTest.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/test/java/org/apache/mina/filter/StreamWriteFilterTest.java?rev=383675&r1=383674&r2=383675&view=diff ============================================================================== --- directory/trunks/mina/core/src/test/java/org/apache/mina/filter/StreamWriteFilterTest.java (original) +++ directory/trunks/mina/core/src/test/java/org/apache/mina/filter/StreamWriteFilterTest.java Mon Mar 6 13:13:20 2006 @@ -383,36 +383,43 @@ SocketAddress address = new InetSocketAddress( "localhost", AvailablePortFinder.getNextAvailable() ); IoConnector connector = new SocketConnector(); - connector.getDefaultConfig().getFilterChain().addFirst( "threadPool", new ThreadPoolFilter() ); + ThreadPoolFilter threadPoolFilter = new ThreadPoolFilter(); + threadPoolFilter.start(); - FixedRandomInputStream stream = new FixedRandomInputStream( 4 * 1024 * 1024 ); - - SenderHandler sender = new SenderHandler( stream ); - ReceiverHandler receiver = new ReceiverHandler( stream.size ); - - acceptor.bind( address, sender ); - - synchronized( sender.lock ) - { - synchronized( receiver.lock ) + try { + connector.getDefaultConfig().getFilterChain().addFirst( "threadPool", threadPoolFilter ); + + FixedRandomInputStream stream = new FixedRandomInputStream( 4 * 1024 * 1024 ); + + SenderHandler sender = new SenderHandler( stream ); + ReceiverHandler receiver = new ReceiverHandler( stream.size ); + + acceptor.bind( address, sender ); + + synchronized( sender.lock ) { - connector.connect( address, receiver ); - - sender.lock.wait(); - receiver.lock.wait(); + synchronized( receiver.lock ) + { + connector.connect( address, receiver ); + + sender.lock.wait(); + receiver.lock.wait(); + } } - } - - acceptor.unbind( address ); - - assertEquals( stream.bytesRead, receiver.bytesRead ); - assertEquals( stream.size, receiver.bytesRead ); - byte[] expectedMd5 = stream.digest.digest(); - byte[] actualMd5 = receiver.digest.digest(); - assertEquals( expectedMd5.length, actualMd5.length ); - for( int i = 0; i < expectedMd5.length; i++ ) - { - assertEquals( expectedMd5[ i ], actualMd5[ i ] ); + + acceptor.unbind( address ); + + assertEquals( stream.bytesRead, receiver.bytesRead ); + assertEquals( stream.size, receiver.bytesRead ); + byte[] expectedMd5 = stream.digest.digest(); + byte[] actualMd5 = receiver.digest.digest(); + assertEquals( expectedMd5.length, actualMd5.length ); + for( int i = 0; i < expectedMd5.length; i++ ) + { + assertEquals( expectedMd5[ i ], actualMd5[ i ] ); + } + } finally { + threadPoolFilter.stop(); } } From commits-returnshane48@example.com Tue Mar 07 05:41:35 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 90157 invoked from network); 7 Mar 2006 05:41:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Mar 2006 05:41:34 -0000 Received: (qmail 54460 invoked by uid 500); 7 Mar 2006 05:41:34 -0000 Delivered-To: shane48@example.com Received: (qmail 54417 invoked by uid 500); 7 Mar 2006 05:41:34 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 54405 invoked by uid 99); 7 Mar 2006 05:41:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 21:41:33 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Mar 2006 21:41:33 -0800 Received: (qmail 90110 invoked by uid 65534); 7 Mar 2006 05:41:12 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383792 - /directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Date: Tue, 07 Mar 2006 05:41:12 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: niklas Date: Mon Mar 6 21:41:10 2006 New Revision: 383792 URL: http://svn.apache.org/viewcvs?rev=383792&view=rev Log: Added Javadoc for the start/stop methods. Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java?rev=383792&r1=383791&r2=383792&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Mon Mar 6 21:41:10 2006 @@ -44,6 +44,15 @@ * This is an implementation of * <a href="http://deuce.doc.wustl.edu/doc/pspdfs/lf.pdf">Leader/Followers * thread pool</a> by Douglas C. Schmidt et al. + * </p> + * <p> + * Use the {@link #start()} and {@link #stop()} methods to force this filter + * to start/stop processing events. Alternatively, {@link #start()} will be + * called automatically the first time an instance of this filter is added + * to a filter chain. Calling {@link #stop()} is not required either since + * all workers are daemon threads which means that any workers still alive + * when the JVM terminates will die automatically. + * </p> * * @author The Apache Directory Project (shane48@example.com) * @version $Rev$, $Date$ @@ -180,6 +189,10 @@ } } + /** + * Starts handling new events. This will be called automatically if not + * already called the first time this filter is added to a filter chain. + */ public void start() { shuttingDown = false; @@ -188,6 +201,9 @@ leader.lead(); } + /** + * Stops handling events and terminates all active worker threads. + */ public void stop() { shuttingDown = true; From commits-returnshane48@example.com Wed Mar 08 03:05:05 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 11318 invoked from network); 8 Mar 2006 03:05:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Mar 2006 03:05:04 -0000 Received: (qmail 6081 invoked by uid 500); 8 Mar 2006 03:05:04 -0000 Delivered-To: shane48@example.com Received: (qmail 6046 invoked by uid 500); 8 Mar 2006 03:05:03 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 6033 invoked by uid 99); 8 Mar 2006 03:05:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Mar 2006 19:05:03 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 07 Mar 2006 19:05:03 -0800 Received: (qmail 11171 invoked by uid 65534); 8 Mar 2006 03:04:42 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r384103 - in /directory/trunks/apacheds: ./ pom.xml Date: Wed, 08 Mar 2006 03:04:42 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Tue Mar 7 19:04:40 2006 New Revision: 384103 URL: http://svn.apache.org/viewcvs?rev=384103&view=rev Log: integrate osgi plugin Modified: directory/trunks/apacheds/ (props changed) directory/trunks/apacheds/pom.xml Propchange: directory/trunks/apacheds/ ------------------------------------------------------------------------------ --- svn:externals (added) +++ svn:externals Tue Mar 7 19:04:40 2006 @@ -0,0 +1,2 @@ +maven-osgi-achetype https://svn.apache.org/repos/asf/incubator/felix/trunk/tools/maven2/osgi-archetype +maven-osgi-plugin https://svn.apache.org/repos/asf/incubator/felix/trunk/tools/maven2/maven-osgi-plugin Modified: directory/trunks/apacheds/pom.xml URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/pom.xml?rev=384103&r1=384102&r2=384103&view=diff ============================================================================== --- directory/trunks/apacheds/pom.xml (original) +++ directory/trunks/apacheds/pom.xml Tue Mar 7 19:04:40 2006 @@ -69,6 +69,8 @@ <jdk>1.5</jdk> </activation> <modules> + <module>maven-osgi-plugin</module> + <module>core</module> <module>core-shared</module> <module>core-plugin</module> @@ -100,6 +102,8 @@ <jdk>1.4</jdk> </activation> <modules> + <module>maven-osgi-plugin</module> + <module>core</module> <module>core-shared</module> <module>core-plugin</module> From commits-returnshane48@example.com Wed Mar 08 07:32:22 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 13703 invoked from network); 8 Mar 2006 07:32:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Mar 2006 07:32:21 -0000 Received: (qmail 35542 invoked by uid 500); 8 Mar 2006 07:32:18 -0000 Delivered-To: shane48@example.com Received: (qmail 35445 invoked by uid 500); 8 Mar 2006 07:32:17 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 35409 invoked by uid 99); 8 Mar 2006 07:32:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Mar 2006 23:32:17 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 07 Mar 2006 23:32:16 -0800 Received: (qmail 13478 invoked by uid 65534); 8 Mar 2006 07:31:55 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r384142 - in /directory/trunks/shared/ldap/src: main/java/org/apache/directory/shared/ldap/codec/extended/operations/ test/java/org/apache/directory/shared/ldap/codec/extended/operations/ Date: Wed, 08 Mar 2006 07:31:54 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ersiner Date: Tue Mar 7 23:31:52 2006 New Revision: 384142 URL: http://svn.apache.org/viewcvs?rev=384142&view=rev Log: Added Stored Procedure Codec and a simple test case Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureContainer.java directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureDecoder.java directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureStatesEnum.java directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java?rev=384142&view=auto ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java Tue Mar 7 23:31:52 2006 @@ -0,0 +1,140 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.shared.ldap.codec.extended.operations; + + +import java.util.ArrayList; +import java.util.List; + + +/** + * Stored Procedure Extended Operation bean + * + * <pre> + * StoredProcedure 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE { + * language OCTETSTRING, + * procedure OCTETSTRING, + * parameters SEQUENCE OF Parameter { + * Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE OF { + * type OCTETSTRING, + * value OCTETSTRING + * } + * } + * } + * </pre> + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + */ +public class StoredProcedure +{ + private String language; + + private byte[] procedure; + + private ArrayList parameters; + + private transient StoredProcedureParameter currentParameter; + + + public String getLanguage() + { + return language; + } + + + public void setLanguage( String language ) + { + this.language = language; + } + + + public byte[] getProcedure() + { + return procedure; + } + + + public void setProcedure( byte[] procedure ) + { + this.procedure = procedure; + } + + + public List getParameters() + { + return parameters; + } + + + public void addParameter( StoredProcedureParameter parameter ) + { + if ( parameters == null ) + { + parameters = new ArrayList(); + } + + parameters.add( parameter ); + } + + + public StoredProcedureParameter getCurrentParameter() + { + return currentParameter; + } + + + public void setCurrentParameter( StoredProcedureParameter currentParameter ) + { + this.currentParameter = currentParameter; + } + + /** + * Bean for representing a Stored Procedure Parameter + */ + public static class StoredProcedureParameter + { + private byte[] type; + + private byte[] value; + + + public byte[] getType() + { + return type; + } + + + public void setType( byte[] type ) + { + this.type = type; + } + + + public byte[] getValue() + { + return value; + } + + + public void setValue( byte[] value ) + { + this.value = value; + } + } + +} Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureContainer.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureContainer.java?rev=384142&view=auto ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureContainer.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureContainer.java Tue Mar 7 23:31:52 2006 @@ -0,0 +1,90 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.shared.ldap.codec.extended.operations; + + +import org.apache.directory.shared.asn1.ber.AbstractContainer; +import org.apache.directory.shared.asn1.ber.IAsn1Container; +import org.apache.directory.shared.asn1.ber.grammar.IGrammar; + + +/** + * A container for the StoredProcedure codec + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + */ +public class StoredProcedureContainer extends AbstractContainer implements IAsn1Container +{ + // ~ Instance fields + // ---------------------------------------------------------------------------- + + /** StoredProcedure */ + private StoredProcedure storedProcedure; + + + // ~ Constructors + // ------------------------------------------------------------------------------- + + public StoredProcedureContainer() + { + super(); + currentGrammar = 0; + grammars = new IGrammar[1]; + grammarStack = new IGrammar[1]; + stateStack = new int[1]; + nbGrammars = 0; + + grammars[StoredProcedureStatesEnum.STORED_PROCEDURE_GRAMMAR] = StoredProcedureGrammar.getInstance(); + + grammarStack[currentGrammar] = grammars[StoredProcedureStatesEnum.STORED_PROCEDURE_GRAMMAR]; + + states = StoredProcedureStatesEnum.getInstance(); + } + + + // ~ Methods + // ------------------------------------------------------------------------------------ + /** + * @return Returns the ldapMessage. + */ + public StoredProcedure getStoredProcedure() + { + return storedProcedure; + } + + + /** + * Set a StoredProcedure object into the container. It will be completed by the + * ldapDecoder. + * + * @param ldapMessage + * The ldapMessage to set. + */ + public void setStoredProcedure( StoredProcedure storedProcedure ) + { + this.storedProcedure = storedProcedure; + } + + + public void clean() + { + super.clean(); + + storedProcedure = null; + } +} Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureDecoder.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureDecoder.java?rev=384142&view=auto ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureDecoder.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureDecoder.java Tue Mar 7 23:31:52 2006 @@ -0,0 +1,36 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.shared.ldap.codec.extended.operations; + + +import org.apache.directory.shared.asn1.ber.Asn1Decoder; + + +/** + * StoredProcedure Decoder + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + */ +public class StoredProcedureDecoder extends Asn1Decoder +{ + + public StoredProcedureDecoder() + { + } + +} Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java?rev=384142&view=auto ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java Tue Mar 7 23:31:52 2006 @@ -0,0 +1,315 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.shared.ldap.codec.extended.operations; + + +import org.apache.directory.shared.asn1.ber.IAsn1Container; +import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar; +import org.apache.directory.shared.asn1.ber.grammar.GrammarAction; +import org.apache.directory.shared.asn1.ber.grammar.GrammarTransition; +import org.apache.directory.shared.asn1.ber.grammar.IGrammar; +import org.apache.directory.shared.asn1.ber.tlv.TLV; +import org.apache.directory.shared.asn1.ber.tlv.UniversalTag; +import org.apache.directory.shared.asn1.codec.DecoderException; +import org.apache.directory.shared.ldap.util.StringTools; +import org.apache.log4j.Logger; +import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedure.StoredProcedureParameter; + + +/** + * ASN.1 BER Grammar for Stored Procedure Extended Operation + * + * <pre> + * StoredProcedure 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE { + * language OCTETSTRING, + * procedure OCTETSTRING, + * parameters SEQUENCE OF Parameter { + * Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE OF { + * type OCTETSTRING, + * value OCTETSTRING + * } + * } + * } + * </pre> + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + */ +public class StoredProcedureGrammar extends AbstractGrammar implements IGrammar +{ + //~ Static fields/initializers ----------------------------------------------------------------- + + /** The logger */ + //private static final Logger log = LoggerFactory.getLogger( StoredProcedureGrammar.class ); + private static final Logger log = Logger.getLogger( StoredProcedureGrammar.class ); + + /** The instance of grammar. StoredProcedureGrammar is a singleton. */ + private static IGrammar instance = new StoredProcedureGrammar(); + + + //~ Constructors ------------------------------------------------------------------------------- + + /** + * Creates a new StoredProcedureGrammar object. + */ + private StoredProcedureGrammar() + { + name = StoredProcedureGrammar.class.getName(); + statesEnum = StoredProcedureStatesEnum.getInstance(); + + // Create the transitions table + super.transitions = new GrammarTransition[StoredProcedureStatesEnum.LAST_STORED_PROCEDURE_STATE][256]; + + //============================================================================================ + // StoredProcedure Message + //============================================================================================ + // StoredProcedure 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE { (Tag) + // ... + // Nothing to do. + super.transitions[StoredProcedureStatesEnum.STORED_PROCEDURE_TAG][UniversalTag.SEQUENCE_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.STORED_PROCEDURE_TAG, StoredProcedureStatesEnum.STORED_PROCEDURE_VALUE, null ); + + // StoredProcedure 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE { (Value) + // ... + // Nothing to do. + super.transitions[StoredProcedureStatesEnum.STORED_PROCEDURE_VALUE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.STORED_PROCEDURE_VALUE, StoredProcedureStatesEnum.LANGUAGE_TAG, null ); + + // language OCTETSTRING, (Tag) + // ... + // Nothing to do + super.transitions[StoredProcedureStatesEnum.LANGUAGE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.LANGUAGE_TAG, StoredProcedureStatesEnum.LANGUAGE_VALUE, null ); + + // language OCTETSTRING, (Value) + // ... + // Store the language. + super.transitions[StoredProcedureStatesEnum.LANGUAGE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.LANGUAGE_VALUE, StoredProcedureStatesEnum.PROCEDURE_TAG, new GrammarAction( + "Stores the language" ) + { + public void action( IAsn1Container container ) throws DecoderException + { + + StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container; + + TLV tlv = storedProcedureContainer.getCurrentTLV(); + + StoredProcedure storedProcedure = null; + + // Store the value. + if ( tlv.getLength().getLength() == 0 ) + { + // We can't have a void language ! + log.error( "The stored procedure language is null" ); + throw new DecoderException( "The stored procedure language cannot be null" ); + } + else + { + // Only this field's type is String by default + String language = StringTools.utf8ToString( tlv.getValue().getData() ); + + if ( log.isDebugEnabled() ) + { + log.debug( "SP language found: " + language ); + } + + storedProcedure = new StoredProcedure(); + storedProcedure.setLanguage( language ); + storedProcedureContainer.setStoredProcedure( storedProcedure ); + } + } + } ); + + // procedure OCTETSTRING, (Tag) + // ... + // Nothing to do + super.transitions[StoredProcedureStatesEnum.PROCEDURE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PROCEDURE_TAG, StoredProcedureStatesEnum.PROCEDURE_VALUE, null ); + + // procedure OCTETSTRING, (Value) + // ... + // Store the procedure. + super.transitions[StoredProcedureStatesEnum.PROCEDURE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PROCEDURE_VALUE, StoredProcedureStatesEnum.PARAMETERS_TAG, new GrammarAction( + "Stores the procedure" ) + { + public void action( IAsn1Container container ) throws DecoderException + { + + StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container; + + TLV tlv = storedProcedureContainer.getCurrentTLV(); + + StoredProcedure storedProcedure = storedProcedureContainer.getStoredProcedure(); + + // Store the value. + if ( tlv.getLength().getLength() == 0 ) + { + // We can't have a void procedure ! + log.error( "The procedure can't be null" ); + throw new DecoderException( "The procedure can't be null" ); + } + else + { + byte[] procedure = tlv.getValue().getData(); + + storedProcedure.setProcedure( procedure ); + } + + if ( log.isDebugEnabled() ) + { + log.debug( "Procedure found : " + storedProcedure.getProcedure() ); + } + } + } ); + + // parameters SEQUENCE OF Parameter { (Tag) + // ... + // Nothing to do + super.transitions[StoredProcedureStatesEnum.PARAMETERS_TAG][UniversalTag.SEQUENCE_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PARAMETERS_TAG, StoredProcedureStatesEnum.PARAMETERS_VALUE, null ); + + // parameters SEQUENCE OF Parameter { (Value) + // ... + // Nothing to do. The list of parameters will be created with the first parameter. + super.transitions[StoredProcedureStatesEnum.PARAMETERS_VALUE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PARAMETERS_VALUE, StoredProcedureStatesEnum.PARAMETER_TYPE_TAG, null ); + + // Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= { + // type OCTETSTRING, (Tag) + // ... + // Nothing to do + super.transitions[StoredProcedureStatesEnum.PARAMETER_TYPE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PARAMETER_TYPE_TAG, StoredProcedureStatesEnum.PARAMETER_TYPE_VALUE, null ); + + // Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= { + // type OCTETSTRING, (Value) + // ... + // Nothing to do + super.transitions[StoredProcedureStatesEnum.PARAMETER_TYPE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PARAMETER_TYPE_VALUE, StoredProcedureStatesEnum.PARAMETER_VALUE_TAG, new GrammarAction( + "Store parameter type" ) + { + public void action( IAsn1Container container ) throws DecoderException + { + StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container; + + TLV tlv = storedProcedureContainer.getCurrentTLV(); + StoredProcedure storedProcedure = storedProcedureContainer.getStoredProcedure(); + + // Store the value. + if ( tlv.getLength().getLength() == 0 ) + { + // We can't have a void parameter type ! + log.error( "The parameter type can't be null" ); + throw new DecoderException( "The parameter type can't be null" ); + } + else + { + StoredProcedureParameter parameter = new StoredProcedureParameter(); + + byte[] parameterType = tlv.getValue().getData(); + + parameter.setType( parameterType ); + + // We store the type in the current parameter. + storedProcedure.setCurrentParameter( parameter ); + + if ( log.isDebugEnabled() ) + { + log.debug( "Parameter type found : " + StringTools.dumpBytes( parameterType ) ); + } + + } + } + } ); + + // Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= { + // ... + // value OCTETSTRING (Tag) + // } + // Nothing to do + super.transitions[StoredProcedureStatesEnum.PARAMETER_VALUE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PARAMETER_VALUE_TAG, StoredProcedureStatesEnum.PARAMETER_VALUE_VALUE, null ); + + // Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= { + // ... + // value OCTETSTRING (Tag) + // } + // Store the parameter value + super.transitions[StoredProcedureStatesEnum.PARAMETER_VALUE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition( + StoredProcedureStatesEnum.PARAMETER_VALUE_VALUE, StoredProcedureStatesEnum.PARAMETER_TYPE_TAG, new GrammarAction( + "Store parameter value" ) + { + public void action( IAsn1Container container ) throws DecoderException + { + StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container; + + TLV tlv = storedProcedureContainer.getCurrentTLV(); + StoredProcedure storedProcedure = storedProcedureContainer.getStoredProcedure(); + + // Store the value. + if ( tlv.getLength().getLength() == 0 ) + { + // We can't have a void parameter value ! + log.error( "The parameter value can't be null" ); + throw new DecoderException( "The parameter value can't be null" ); + } + else + { + byte[] parameterValue = tlv.getValue().getData(); + + if ( parameterValue.length != 0 ) + { + StoredProcedureParameter parameter = storedProcedure.getCurrentParameter(); + parameter.setValue( parameterValue ); + + // We can now add a new Parameter to the pojo + storedProcedure.addParameter( parameter ); + + if ( log.isDebugEnabled() ) + { + log.debug( "Parameter value found : " + StringTools.dumpBytes( parameterValue ) ); + } + } + else + { + log.error( "The parameter value is empty. This is not allowed." ); + throw new DecoderException( "The parameter value is empty. This is not allowed." ); + } + } + + // The only possible END state for the grammar is here + container.grammarEndAllowed( true ); + } + } ); + } + + + //~ Methods ------------------------------------------------------------------------------------ + + /** + * Get the instance of this grammar + * + * @return An instance on the StoredProcedure Grammar + */ + public static IGrammar getInstance() + { + return instance; + } +} Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureStatesEnum.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureStatesEnum.java?rev=384142&view=auto ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureStatesEnum.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureStatesEnum.java Tue Mar 7 23:31:52 2006 @@ -0,0 +1,200 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.shared.ldap.codec.extended.operations; + + +import org.apache.directory.shared.asn1.ber.grammar.IGrammar; +import org.apache.directory.shared.asn1.ber.grammar.IStates; + + +/** + * Constants for StoredProcedureGrammar + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + */ +public class StoredProcedureStatesEnum implements IStates +{ + //~ Static fields/initializers ----------------------------------------------------------------- + + //========================================================================= + // StoredProcedure + //========================================================================= + /** StoredProcedure Tag */ + public static int STORED_PROCEDURE_TAG = 0; + + /** StoredProcedure Value */ + public static int STORED_PROCEDURE_VALUE = 1; + + // Language --------------------------------------------------------------- + /** Language Tag */ + public static int LANGUAGE_TAG = 2; + + /** Language Value */ + public static int LANGUAGE_VALUE = 3; + + // Procedure -------------------------------------------------------------- + /** Procedure Tag */ + public static int PROCEDURE_TAG = 4; + + /** Procedure Value */ + public static int PROCEDURE_VALUE = 5; + + // Parameters ------------------------------------------------------------- + /** Parameters Tag */ + public static int PARAMETERS_TAG = 6; + + /** Parameters Value */ + public static int PARAMETERS_VALUE = 7; + + // Parameter type --------------------------------------------------------- + /** Parameter type Tag */ + public static int PARAMETER_TYPE_TAG = 8; + + /** Parameter type Value */ + public static int PARAMETER_TYPE_VALUE = 9; + + // Parameters value ------------------------------------------------------- + /** Parameter value Tag */ + public static int PARAMETER_VALUE_TAG = 10; + + /** Parameter value Value */ + public static int PARAMETER_VALUE_VALUE = 11; + + public static int LAST_STORED_PROCEDURE_STATE = 12; + + //========================================================================= + // Grammars declaration. + //========================================================================= + /** Ldap Message Grammar */ + public static final int STORED_PROCEDURE_GRAMMAR_SWITCH = 0x0100; + + /** LdapMessage grammar number */ + public static final int STORED_PROCEDURE_GRAMMAR = 0; + + /** The total number of grammars used */ + public static final int NB_GRAMMARS = 1; + + //========================================================================= + // Grammar switches debug strings + //========================================================================= + /** A string representation of grammars */ + private static String[] GrammarSwitchString = new String[] + { "STORED_PROCEDURE_GRAMMAR_SWITCH", }; + + //========================================================================= + // States debug strings + //========================================================================= + /** A string representation of all the states */ + private static String[] StoredProcedureString = new String[] + { "STORED_PROCEDURE_TAG", "STORED_PROCEDURE_VALUE", "LANGUAGE_TAG", "LANGUAGE_VALUE", "PROCEDURE_TAG", + "PROCEDURE_VALUE", "PARAMETERS_TAG", "PARAMETERS_VALUE", "PARAMETER_TYPE_TAG", "PARAMETER_TYPE_VALUE", + "PARAMETER_VALUE_TAG", "PARAMETER_VALUE_VALUE" }; + + /** The instance */ + private static StoredProcedureStatesEnum instance = new StoredProcedureStatesEnum(); + + + //~ Constructors ------------------------------------------------------------------------------- + + /** + * This is a private constructor. This class is a singleton + * + */ + private StoredProcedureStatesEnum() + { + } + + + //~ Methods ------------------------------------------------------------------------------------ + + /** + * Get an instance of this class + * @return An instance on this class + */ + public static IStates getInstance() + { + return instance; + } + + + /** + * Get the grammar name + * @param The grammar code + * @return The grammar name + */ + public String getGrammarName( int grammar ) + { + switch ( grammar ) + { + case STORED_PROCEDURE_GRAMMAR: + return "STORED_PROCEDURE_GRAMMAR"; + + default: + return "UNKNOWN"; + } + } + + + /** + * Get the grammar name + * @param The grammar class + * @return The grammar name + */ + public String getGrammarName( IGrammar grammar ) + { + if ( grammar instanceof StoredProcedureGrammar ) + { + return "STORED_PROCEDURE_GRAMMAR"; + } + else + { + return "UNKNOWN GRAMMAR"; + } + } + + + /** + * Get the string representing the state + * + * @param grammar The current grammar being used + * @param state The state number + * @return The String representing the state + */ + public String getState( int grammar, int state ) + { + + if ( ( state & GRAMMAR_SWITCH_MASK ) != 0 ) + { + return ( state == END_STATE ) ? "END_STATE" + : GrammarSwitchString[( ( state & GRAMMAR_SWITCH_MASK ) >> 8 ) - 1]; + } + else + { + + switch ( grammar ) + { + + case STORED_PROCEDURE_GRAMMAR: + return ( ( state == GRAMMAR_END ) ? "STORED_PROCEDURE_END_STATE" : StoredProcedureString[state] ); + + default: + return "UNKNOWN"; + } + } + } +} Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java?rev=384142&view=auto ============================================================================== --- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java (added) +++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java Tue Mar 7 23:31:52 2006 @@ -0,0 +1,101 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.shared.ldap.codec.extended.operations; + + +import java.nio.ByteBuffer; + +import javax.naming.NamingException; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.directory.shared.asn1.ber.Asn1Decoder; +import org.apache.directory.shared.asn1.ber.IAsn1Container; +import org.apache.directory.shared.asn1.codec.DecoderException; +import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedure.StoredProcedureParameter; +import org.apache.directory.shared.ldap.util.StringTools; + + +/* + * TestCase for a Stored Procedure Extended Operation ASN.1 codec + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + */ +public class StoredProcedureTest extends TestCase +{ + public void testDecodeStoredProcedure() throws NamingException + { + Asn1Decoder storedProcedureDecoder = new StoredProcedureDecoder(); + + ByteBuffer stream = ByteBuffer.allocate( 0x3E ); + + stream.put( new byte[] + { + 0x30, 0x3C, + 0x04, 0x04, 'J', 'a', 'v', 'a', + 0x04, 0x07, 'e', 'x', 'e', 'c', 'u', 't', 'e', + 0x30, 0x2B, + 0x04, 0x03, 'i', 'n', 't', 0x04, 0x01, 0x01, + 0x04, 0x07, 'b', 'o', 'o', 'l', 'e', 'a', 'n', 0x04, 0x04, 't', 'r', 'u', 'e', + 0x04, 0x06, 'S', 't', 'r', 'i', 'n', 'g', 0x04, 0x0A, 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '3' + } ); + + //String decodedPdu = StringTools.dumpBytes( stream.array() ); + stream.flip(); + + // Allocate a StoredProcedure Container + IAsn1Container storedProcedureContainer = new StoredProcedureContainer(); + + // Decode a StoredProcedure message + try + { + storedProcedureDecoder.decode( stream, storedProcedureContainer ); + } + catch ( DecoderException de ) + { + de.printStackTrace(); + Assert.fail( de.getMessage() ); + } + + StoredProcedure storedProcedure = ( ( StoredProcedureContainer ) storedProcedureContainer ).getStoredProcedure(); + + Assert.assertEquals("Java", storedProcedure.getLanguage()); + + Assert.assertEquals( "execute", StringTools.utf8ToString( storedProcedure.getProcedure() ) ); + + Assert.assertNotNull( storedProcedure.getParameters() ); + Assert.assertEquals( 3, storedProcedure.getParameters().size() ); + + StoredProcedureParameter param = ( StoredProcedureParameter ) storedProcedure.getParameters().get( 0 ); + + Assert.assertEquals( "int", StringTools.utf8ToString( param.getType() ) ); + Assert.assertEquals( 1, param.getValue()[0] ); + + param = ( StoredProcedureParameter ) storedProcedure.getParameters().get( 1 ); + + Assert.assertEquals( "boolean", StringTools.utf8ToString( param.getType() ) ); + Assert.assertEquals( "true", StringTools.utf8ToString( param.getValue() ) ); + + param = ( StoredProcedureParameter ) storedProcedure.getParameters().get( 2 ); + + Assert.assertEquals( "String", StringTools.utf8ToString( param.getType() ) ); + Assert.assertEquals( "parameter3", StringTools.utf8ToString( param.getValue() ) ); + + } +} From commits-returnshane48@example.com Wed Mar 08 12:16:01 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 64554 invoked from network); 8 Mar 2006 12:16:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Mar 2006 12:16:01 -0000 Received: (qmail 65256 invoked by uid 500); 8 Mar 2006 12:16:00 -0000 Delivered-To: shane48@example.com Received: (qmail 65193 invoked by uid 500); 8 Mar 2006 12:15:59 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 65181 invoked by uid 99); 8 Mar 2006 12:15:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 04:15:59 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Mar 2006 04:15:58 -0800 Received: (qmail 64420 invoked by uid 65534); 8 Mar 2006 12:15:38 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r384195 - in /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations: StoredProcedure.java StoredProcedureGrammar.java Date: Wed, 08 Mar 2006 12:15:37 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ersiner Date: Wed Mar 8 04:15:33 2006 New Revision: 384195 URL: http://svn.apache.org/viewcvs?rev=384195&view=rev Log: Made cosmetic changes Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java?rev=384195&r1=384194&r2=384195&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java Wed Mar 8 04:15:33 2006 @@ -25,19 +25,6 @@ /** * Stored Procedure Extended Operation bean * - * <pre> - * StoredProcedure 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE { - * language OCTETSTRING, - * procedure OCTETSTRING, - * parameters SEQUENCE OF Parameter { - * Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE OF { - * type OCTETSTRING, - * value OCTETSTRING - * } - * } - * } - * </pre> - * * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> */ public class StoredProcedure Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java?rev=384195&r1=384194&r2=384195&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureGrammar.java Wed Mar 8 04:15:33 2006 @@ -34,19 +34,6 @@ /** * ASN.1 BER Grammar for Stored Procedure Extended Operation * - * <pre> - * StoredProcedure 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE { - * language OCTETSTRING, - * procedure OCTETSTRING, - * parameters SEQUENCE OF Parameter { - * Parameter 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= SEQUENCE OF { - * type OCTETSTRING, - * value OCTETSTRING - * } - * } - * } - * </pre> - * * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> */ public class StoredProcedureGrammar extends AbstractGrammar implements IGrammar @@ -279,7 +266,7 @@ StoredProcedureParameter parameter = storedProcedure.getCurrentParameter(); parameter.setValue( parameterValue ); - // We can now add a new Parameter to the pojo + // We can now add a new Parameter to the procedure storedProcedure.addParameter( parameter ); if ( log.isDebugEnabled() ) From commits-returnshane48@example.com Wed Mar 08 13:25:19 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 11824 invoked from network); 8 Mar 2006 13:25:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Mar 2006 13:25:18 -0000 Received: (qmail 2956 invoked by uid 500); 8 Mar 2006 13:25:17 -0000 Delivered-To: shane48@example.com Received: (qmail 2903 invoked by uid 500); 8 Mar 2006 13:25:17 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 2892 invoked by uid 99); 8 Mar 2006 13:25:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 05:25:17 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Mar 2006 05:25:16 -0800 Received: (qmail 11632 invoked by uid 65534); 8 Mar 2006 13:24:56 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r384210 - /directory/trunks/apacheds/core/src/main/schema/apache.schema Date: Wed, 08 Mar 2006 13:24:55 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ersiner Date: Wed Mar 8 05:24:54 2006 New Revision: 384210 URL: http://svn.apache.org/viewcvs?rev=384210&view=rev Log: Updated and added some schema definitions for Ldap Class Loader. Modified: directory/trunks/apacheds/core/src/main/schema/apache.schema Modified: directory/trunks/apacheds/core/src/main/schema/apache.schema URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/schema/apache.schema?rev=384210&r1=384209&r2=384210&view=diff ============================================================================== --- directory/trunks/apacheds/core/src/main/schema/apache.schema (original) +++ directory/trunks/apacheds/core/src/main/schema/apache.schema Wed Mar 8 05:24:54 2006 @@ -197,19 +197,43 @@ STRUCTURAL MUST ( unixFilePath ) ) +#attributetype ( 83.161.120.155.4.1.1883.161.120.155.3.21 +# NAME 'fqcn' +# DESC 'The fully qualified class name of a java class' +# EQUALITY caseExactIA5Match +# SYNTAX 83.161.120.155.4.1.1483.161.120.155.26 SINGLE-VALUE ) +# +#attributetype ( 83.161.120.155.4.1.1883.161.120.155.3.22 +# NAME 'byteCode' +# DESC 'The actual byte code for a java class' +# SYNTAX 83.161.120.155.4.1.1483.161.120.155.5 SINGLE-VALUE ) +# +#objectclass ( 83.161.120.155.4.1.1883.161.120.155.4.8 +# NAME 'javaClass' +# SUP top +# STRUCTURAL +# MUST ( fqcn $ byteCode ) ) + attributetype ( 83.161.120.155.4.1.1883.161.120.155.3.21 - NAME 'fqcn' - DESC 'The fully qualified class name of a java class' - EQUALITY caseExactIA5Match - SYNTAX 83.161.120.155.4.1.1483.161.120.155.26 SINGLE-VALUE ) + NAME 'fullyQualifiedClassName' + DESC 'The fully qualified name for a (Java) class' + EQUALITY caseExactIA5Match + SYNTAX 83.161.120.155.4.1.1483.161.120.155.26 SINGLE-VALUE ) attributetype ( 83.161.120.155.4.1.1883.161.120.155.3.22 NAME 'byteCode' - DESC 'The actual byte code for a java class' - SYNTAX 83.161.120.155.4.1.1483.161.120.155.5 SINGLE-VALUE ) + DESC 'The actual byte code for a (Java) class' + SYNTAX 83.161.120.155.4.1.1483.161.120.155.5 SINGLE-VALUE ) objectclass ( 83.161.120.155.4.1.1883.161.120.155.4.8 NAME 'javaClass' SUP top STRUCTURAL - MUST ( fqcn $ byteCode ) ) + MUST ( fullyQualifiedClassName $ byteCode ) ) + +attributetype ( 83.161.120.155.4.1.1883.161.120.155.3.23 + NAME 'classLoaderDefaultSearchContext' + DESC 'The default search context for the Ldap Class Loader' + SUP distinguishedName + EQUALITY distinguishedNameMatch + SYNTAX 83.161.120.155.4.1.1483.161.120.155.12 ) \ No newline at end of file From commits-returnshane48@example.com Wed Mar 08 13:32:23 2006 Return-Path: <commits-returnshane48@example.com> Delivered-To: shane48@example.com Received: (qmail 16566 invoked from network); 8 Mar 2006 13:32:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Mar 2006 13:32:22 -0000 Received: (qmail 19764 invoked by uid 500); 8 Mar 2006 13:32:22 -0000 Delivered-To: shane48@example.com Received: (qmail 19724 invoked by uid 500); 8 Mar 2006 13:32:21 -0000 Mailing-List: contact shane48@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:shane48@example.com> List-Unsubscribe: <mailto:shane48@example.com> List-Post: <mailto:shane48@example.com> List-Id: <commits.directory.apache.org> Reply-To: shane48@example.com Delivered-To: mailing list shane48@example.com Received: (qmail 19713 invoked by uid 99); 8 Mar 2006 13:32:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 05:32:21 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Mar 2006 05:32:20 -0800 Received: (qmail 16030 invoked by uid 65534); 8 Mar 2006 13:31:54 -0000 Message-ID: <shane48@example.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r384211 - in /directory/trunks/apacheds: core-unit/src/test/java/org/apache/directory/server/core/sp/ core/src/main/java/org/apache/directory/server/core/sp/ Date: Wed, 08 Mar 2006 13:31:53 -0000 To: shane48@example.com From: shane48@example.com X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ersiner Date: Wed Mar 8 05:31:52 2006 New Revision: 384211 URL: http://svn.apache.org/viewcvs?rev=384211&view=rev Log: Added a basic implementation of the Ldap Class Loader Added a test case which includes both of the search methods available: - first test finds the class entry somewhere in the DIT - second test finds the class entry in a predetermined (via a configuration entry) location Added: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/sp/ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderTest.java directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Added: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderTest.java URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderTest.java?rev=384211&view=auto ============================================================================== --- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderTest.java (added) +++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderTest.java Wed Mar 8 05:31:52 2006 @@ -0,0 +1,124 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.directory.server.core.sp; + + +import javax.naming.Context; +import javax.naming.directory.Attribute; +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttribute; +import javax.naming.directory.BasicAttributes; + +import org.apache.directory.server.core.jndi.ServerLdapContext; +import org.apache.directory.server.core.unit.AbstractAdminTestCase; +import org.apache.directory.shared.ldap.util.Base64; + + +/** + * Test case for LdapClassLoader. + * + * @author <a href="mailto:shane48@example.com">Apache Directory Project</a> + * @version $Rev$ $Date$ + */ +public class LdapClassLoaderTest extends AbstractAdminTestCase +{ + private static final String HELLOWORLD_CLASS_BASE64 = "yv66vgAAADEAHQoABgAPCQAQABEIABIKABMAFAcAFQcAFgEABjxpbml0PgEAAygpV" + + "gEABENvZGUBAA9MaW5lTnVtYmVyVGFibGUBAARtYWluAQAWKFtMamF2YS9sYW5nL1N0cmluZzsp" + + "VgEAClNvdXJjZUZpbGUBAA9IZWxsb1dvcmxkLmphdmEMAAcACAcAFwwAGAAZAQAMSGVsbG8gV29" + + "ybGQhBwAaDAAbABwBAApIZWxsb1dvcmxkAQAQamF2YS9sYW5nL09iamVjdAEAEGphdmEvbGFuZy" + + "9TeXN0ZW0BAANvdXQBABVMamF2YS9pby9QcmludFN0cmVhbTsBABNqYXZhL2lvL1ByaW50U3RyZ" + + "WFtAQAHcHJpbnRsbgEAFShMamF2YS9sYW5nL1N0cmluZzspVgAhAAUABgAAAAAAAgABAAcACAAB" + +
{'source': 'Apache Software Foundation Public Mail Archives'}