Skip to content

Commit

Permalink
restructred sub packages
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@233 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
  • Loading branch information
chiba committed Jan 11, 2006
1 parent 5b8d2d6 commit 52a4556
Show file tree
Hide file tree
Showing 55 changed files with 1,303 additions and 140 deletions.
24 changes: 14 additions & 10 deletions Readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h3>3. sample/reflect/*.java</h3>

<ul><pre>
% javac sample/reflect/*.java
% java javassist.reflect.Loader sample.reflect.Main Joe
% java javassist.tools.reflect.Loader sample.reflect.Main Joe
</pre></ul>

<p>Compare this result with that of the regular execution without reflection:
Expand All @@ -151,7 +151,7 @@ <h3>3. sample/reflect/*.java</h3>
To do this, type the commands:

<ul><pre>
% java javassist.reflect.Compiler sample.reflect.Person -m sample.reflect.VerboseMetaobj
% java javassist.tools.reflect.Compiler sample.reflect.Person -m sample.reflect.VerboseMetaobj
</pre></ul>

<p> Then,
Expand Down Expand Up @@ -292,14 +292,18 @@ <h2>Changes</h2>
<li>The return type of CtClass.stopPruning() was changed from void
to boolean.
<li>toMethod() in javassist.CtConstructor has been implemented.
<li>javassist.preproc package was elminated and the source was
moved to the sample directory.
</ul>

<p>- version 3.1

<ul>
<li>javassist.tool package was renamed to javassist.tools.
<li>It includes new javassist.util.proxy package
similar to Enhancer of CGLIB.

<p>
<li>The subpackages of Javassist were restructured.
<ul>
<li>javassist.tool package was renamed to javassist.tools.
<li>HotSwapper was moved to javassist.util.
<li>Several subpackages were moved to javassist.tools.
<li>javassist.preproc package was elminated and the source was
moved to the sample directory.
</ul>
</ul>

<p>- version 3.1 RC2 in September 7, 2005
Expand Down
15 changes: 9 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ to ${build.classes.dir}.</echo>
excludepackagenames="javassist.compiler.*,javassist.convert.*"
sourcepath="src/main"
defaultexcludes="yes"
locale="en_US"
charset="iso-8859-1"
destdir="html"
author="true"
version="true"
use="true"
Locale="en_US"
charset="iso-8859-1"
Public="true"
public="true"
nohelp="true"
windowtitle="Javassist API">
<doctitle><![CDATA[<h1>Javassist</h1>]]></doctitle>
<bottom><![CDATA[<i>Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2005 Shigeru Chiba. All Rights Reserved.</i>]]></bottom>
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>

Expand Down Expand Up @@ -151,7 +151,8 @@ Copyright (C) 1999-2005 Shigeru Chiba. All Rights Reserved.</i>]]></bottom>

<target name = "sample-all"
depends="sample-test,sample-reflect,sample-duplicate,sample-vector">
<echo>** please run sample-rmi and sample-evolve separately **</echo>
<echo>** please run sample-rmi, sample-evolve, and</echo>
<echo> sample-hotswap (or -hotswap5) separately **</echo>
</target>

<target name = "sample-test" depends="sample" >
Expand All @@ -161,7 +162,7 @@ Copyright (C) 1999-2005 Shigeru Chiba. All Rights Reserved.</i>]]></bottom>
</target>

<target name = "sample-reflect" depends="sample" >
<java fork="true" dir="${run.dir}" classname="javassist.reflect.Loader">
<java fork="true" dir="${run.dir}" classname="javassist.tools.reflect.Loader">
<classpath refid="classpath"/>
<arg line="sample.reflect.Main Joe" />
</java>
Expand Down Expand Up @@ -212,6 +213,7 @@ Copyright (C) 1999-2005 Shigeru Chiba. All Rights Reserved.</i>]]></bottom>
<!-- for JDK 1.4 -->
<target name = "sample-hotswap" depends="sample">
<echo>** JAVA_HOME/lib/tools.jar must be included in CLASS_PATH</echo>
<echo>** for JDK 1.4</echo>
<java fork="true" dir="${run.dir}" classname="Test">
<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000" />
<classpath refid="classpath"/>
Expand All @@ -221,6 +223,7 @@ Copyright (C) 1999-2005 Shigeru Chiba. All Rights Reserved.</i>]]></bottom>
<!-- for Java 5 -->
<target name = "sample-hotswap5" depends="sample">
<echo>** JAVA_HOME/lib/tools.jar must be included in CLASS_PATH</echo>
<echo>** for JDK 1.5 or later</echo>
<java fork="true" dir="${run.dir}" classname="Test">
<jvmarg line="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000" />
<classpath refid="classpath"/>
Expand Down
2 changes: 1 addition & 1 deletion sample/duplicate/DuplicatedObject.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sample.duplicate;

import javassist.reflect.*;
import javassist.tools.reflect.*;

public class DuplicatedObject extends Metaobject {
private DuplicatedObject backup;
Expand Down
8 changes: 4 additions & 4 deletions sample/duplicate/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
Runtime metaobject (JDK 1.2 or later only).
With the javassist.reflect package, the users can attach a metaobject
With the javassist.tools.reflect package, the users can attach a metaobject
to an object. The metaobject can control the behavior of the object.
For example, you can implement fault tolerancy with this ability. One
of the implementation techniques of fault tolernacy is to make a copy
Expand All @@ -30,15 +30,15 @@ Runtime metaobject (JDK 1.2 or later only).
% java sample.duplicate.Main
You would see two balls in a window. This is because
sample.duplicate.Viewer is loaded by javassist.reflect.Loader so that
sample.duplicate.Viewer is loaded by javassist.tools.reflect.Loader so that
a metaobject would be attached.
*/
public class Main {
public static void main(String[] args) throws Throwable {
javassist.reflect.Loader cl = new javassist.reflect.Loader();
javassist.tools.reflect.Loader cl = new javassist.tools.reflect.Loader();
cl.makeReflective("sample.duplicate.Ball",
"sample.duplicate.DuplicatedObject",
"javassist.reflect.ClassMetaobject");
"javassist.tools.reflect.ClassMetaobject");
cl.run("sample.duplicate.Viewer", args);
}
}
2 changes: 1 addition & 1 deletion sample/evolve/DemoServer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sample.evolve;

import javassist.web.*;
import javassist.tools.web.*;
import java.io.*;

/**
Expand Down
6 changes: 3 additions & 3 deletions sample/evolve/Evolution.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public void onLoad(ClassPool _pool, String classname)
private void onLoadUpdatable(String classname) throws NotFoundException,
CannotCompileException {
// if the class is a concrete class,
// classname is <updatableClassName>$<version>.
// classname is <updatableClassName>$$<version>.

int i = classname.lastIndexOf('$');
int i = classname.lastIndexOf("$$");
if (i <= 0)
return;

Expand All @@ -72,7 +72,7 @@ private void onLoadUpdatable(String classname) throws NotFoundException,

int version;
try {
version = Integer.parseInt(classname.substring(i + 1));
version = Integer.parseInt(classname.substring(i + 2));
}
catch (NumberFormatException e) {
throw new NotFoundException(classname, e);
Expand Down
2 changes: 1 addition & 1 deletion sample/evolve/VersionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static Class getUpdatedClass(String qualifiedClassname)
else
version = ((Integer)found).intValue() + 1;

Class c = Class.forName(qualifiedClassname + '$' + version);
Class c = Class.forName(qualifiedClassname + "$$" + version);
versionNo.put(qualifiedClassname, new Integer(version));
return c;
}
Expand Down
2 changes: 1 addition & 1 deletion sample/hotswap/Test.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.io.*;
import javassist.tools.HotSwapper;
import javassist.util.HotSwapper;

public class Test {
public static void main(String[] args) throws Exception {
Expand Down
6 changes: 3 additions & 3 deletions sample/reflect/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sample.reflect;

import javassist.reflect.Loader;
import javassist.tools.reflect.Loader;

/*
The "verbose metaobject" example (JDK 1.2 or later only).
Expand All @@ -14,7 +14,7 @@
To run,
% java javassist.reflect.Loader sample.reflect.Main Joe
% java javassist.tools.reflect.Loader sample.reflect.Main Joe
Compare this result with that of the regular execution without reflection:
Expand All @@ -25,7 +25,7 @@ public static void main(String[] args) throws Throwable {
Loader cl = (Loader)Main.class.getClassLoader();
cl.makeReflective("sample.reflect.Person",
"sample.reflect.VerboseMetaobj",
"javassist.reflect.ClassMetaobject");
"javassist.tools.reflect.ClassMetaobject");

cl.run("sample.reflect.Person", args);
}
Expand Down
4 changes: 2 additions & 2 deletions sample/reflect/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

package sample.reflect;

import javassist.reflect.Metalevel;
import javassist.reflect.Metaobject;
import javassist.tools.reflect.Metalevel;
import javassist.tools.reflect.Metaobject;

public class Person {
public String name;
Expand Down
2 changes: 1 addition & 1 deletion sample/reflect/VerboseMetaobj.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sample.reflect;

import javassist.reflect.*;
import javassist.tools.reflect.*;

public class VerboseMetaobj extends Metaobject {
public VerboseMetaobj(Object self, Object[] args) {
Expand Down
6 changes: 3 additions & 3 deletions sample/rmi/CountApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javassist.rmi.ObjectImporter;
import javassist.rmi.ObjectNotFoundException;
import javassist.web.Viewer;
import javassist.tools.rmi.ObjectImporter;
import javassist.tools.rmi.ObjectNotFoundException;
import javassist.tools.web.Viewer;

public class CountApplet extends Applet implements ActionListener {
private Font font;
Expand Down
2 changes: 1 addition & 1 deletion sample/rmi/Counter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sample.rmi;

import javassist.rmi.AppletServer;
import javassist.tools.rmi.AppletServer;
import java.io.IOException;
import javassist.CannotCompileException;
import javassist.NotFoundException;
Expand Down
2 changes: 1 addition & 1 deletion sample/rmi/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ <h2><a href="webdemo.html">

<p>If you don't want to use a web browser, do as follows:

<ul><pre>% java javassist.web.Viewer localhost 5001 sample.rmi.CountApplet</pre></ul>
<ul><pre>% java javassist.tools.web.Viewer localhost 5001 sample.rmi.CountApplet</pre></ul>
8 changes: 4 additions & 4 deletions sample/rmi/webdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h2>Remote Method Invocation</h2>
local object. The applet can communicate through a socket with the
host that executes the web server distributing that applet. However,
the applet cannot directly call a method on an object if the object is
on a remote host. The <code>javassist.rmi</code> package provides
on a remote host. The <code>javassist.tools.rmi</code> package provides
a mechanism for the applet to transparently access the remote object.
The rules that the applet must be subject to are simpler than the
standard Java RMI.
Expand Down Expand Up @@ -36,7 +36,7 @@ <h3>1. Sample applet</h3>
<p><b>Figure 1: Applet</b>

<pre>
<font color="red">import javassist.rmi.ObjectImporter;</font>
<font color="red">import javassist.tools.rmi.ObjectImporter;</font>

public class CountApplet extends Applet implements ActionListener {
private Font font;
Expand Down Expand Up @@ -106,7 +106,7 @@ <h3>1. Sample applet</h3>
}
</pre>

<p>Note that the <code>javassist.rmi</code> package does not require
<p>Note that the <code>javassist.tools.rmi</code> package does not require
the <code>Counter</code> class to be an interface unlike the Java RMI,
with which <code>Counter</code> must be an interface and it must be
implemented by another class.
Expand Down Expand Up @@ -167,7 +167,7 @@ <h3>2. Features</h3>
<p> With the Java RMI or Voyager, the applet programmer must define
an interface for every remote object class and access the remote object
through that interface.
On the other hand, the <code>javassist.rmi</code> package does not
On the other hand, the <code>javassist.tools.rmi</code> package does not
require the programmer to follow that programming convention.
It is suitable for writing simple distributed programs like applets.

Expand Down
2 changes: 1 addition & 1 deletion src/main/javassist/CtClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ public CtMethod[] getMethods() {
*
* @param name method name
* @param desc method descriptor
* @see CtBehavior.getSignature()
* @see CtBehavior#getSignature()
* @see javassist.bytecode.Descriptor
*/
public CtMethod getMethod(String name, String desc)
Expand Down
2 changes: 1 addition & 1 deletion src/main/javassist/CtMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public CtMethod(CtMethod src, CtClass declaring, ClassMap map)
*
* @param src the source text.
* @param declaring the class to which the created method is added.
* @see CtNewMethod.make(String, CtClass)
* @see CtNewMethod#make(String, CtClass)
*/
public static CtMethod make(String src, CtClass declaring)
throws CannotCompileException
Expand Down
2 changes: 1 addition & 1 deletion src/main/javassist/bytecode/Bytecode.java
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ public void addPutstatic(CtClass c, String name, String desc) {
* Appends PUTSTATIC.
*
* @param classname the fully-qualified name of the target class.
* @param filedName the field name.
* @param fieldName the field name.
* @param desc the descriptor of the field type.
*/
public void addPutstatic(String classname, String fieldName, String desc) {
Expand Down
1 change: 0 additions & 1 deletion src/main/javassist/bytecode/Descriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ public boolean hasNext() {

/**
* Returns the first character of the current element.
* @return
*/
public char currentChar() { return desc.charAt(curPos); }

Expand Down
2 changes: 1 addition & 1 deletion src/main/javassist/bytecode/annotation/package.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
Annotations API.
Bytecode-level Annotations API.

<p>This package provides low-level API for editing annotations attributes.

Expand Down
2 changes: 1 addition & 1 deletion src/main/javassist/expr/MethodCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public CtMethod getMethod() throws NotFoundException {
* The method signature is represented by a character string
* called method descriptor, which is defined in the JVM specification.
*
* @see javassist.CtBehavior.getSignature()
* @see javassist.CtBehavior#getSignature()
* @see javassist.bytecode.Descriptor
* @since 3.1
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/javassist/tools/package.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<body>
Utility classes.
Covenient tools.

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* License.
*/

package javassist.reflect;
package javassist.tools.reflect;

/**
* Signals that <code>ClassMetaobject.newInstance()</code> fails.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* License.
*/

package javassist.reflect;
package javassist.tools.reflect;

import java.lang.reflect.InvocationTargetException;
import java.lang.IllegalAccessException;
Expand All @@ -22,9 +22,9 @@
* Thrown when method invocation using the reflection API has thrown
* an exception.
*
* @see javassist.reflect.Metaobject#trapMethodcall(int, Object[])
* @see javassist.reflect.ClassMetaobject#trapMethodcall(int, Object[])
* @see javassist.reflect.ClassMetaobject#invoke(Object, int, Object[])
* @see javassist.tools.reflect.Metaobject#trapMethodcall(int, Object[])
* @see javassist.tools.reflect.ClassMetaobject#trapMethodcall(int, Object[])
* @see javassist.tools.reflect.ClassMetaobject#invoke(Object, int, Object[])
*/
public class CannotInvokeException extends RuntimeException {

Expand Down
Loading

0 comments on commit 52a4556

Please sign in to comment.