You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2006/09/04 14:56:02 UTC
svn commit: r440060 -
/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
Author: ersiner
Date: Mon Sep 4 05:56:02 2006
New Revision: 440060
URL: http://svn.apache.org/viewvc?view=rev&rev=440060
Log:
Added some javadoc.
Renamed schema elements that represents Java classes.
Modified:
directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java?view=diff&rev=440060&r1=440059&r2=440060
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java Mon Sep 4 05:56:02 2006
@@ -46,14 +46,10 @@
{
/**
- * Returns the stream data of a Java class file
- * whose fully qualified name is provided.
+ * Returns the stream data of a Java class.
*
- * @param fullClassName
- * Fully qualified name of the class
- * with package name included and ".class" extension excluded.
- * @param resourceLoader
- * The resource loader for the Stored Procedure Class.
+ * @param class
+ * The class whose stream data will be retrieved.
* @return
* Stream data of the class file as a byte array.
* @throws NamingException
@@ -64,13 +60,11 @@
String fullClassName = clazz.getName();
int lastDot = fullClassName.lastIndexOf( '.' );
String classFileName = fullClassName.substring( lastDot + 1 ) + ".class";
-
URL url = clazz.getResource( classFileName );
InputStream in = clazz.getResourceAsStream( classFileName );
File file = new File( url.getFile() );
int size = ( int ) file.length();
byte[] buf = new byte[size];
-
try
{
in.read( buf );
@@ -91,11 +85,8 @@
*
* @param ctx
* The parent context of the Java class entry to be loaded.
- * @param fullClassName
- * Fully qualified name of the class
- * with package name included and ".class" extension excluded.
- * @param resourceLoader
- * The resource loader for the Stored Procedure Class.
+ * @param clazz
+ * Class to be loaded.
* @throws NamingException
* If an error occurs during creating the subcontext.
*/
@@ -106,10 +97,10 @@
Attributes attributes = new BasicAttributes( "objectClass", "top", true );
attributes.get( "objectClass" ).add( "javaClass" );
- attributes.put( "fullyQualifiedClassName", fullClassName );
- attributes.put( "byteCode", buf );
+ attributes.put( "javaClassName", fullClassName );
+ attributes.put( "javaClassByteCode", buf );
- ctx.createSubcontext( "fullyQualifiedClassName=" + fullClassName , attributes );
+ ctx.createSubcontext( "javaClassName=" + fullClassName , attributes );
}
/**