Skip to content

Commit

Permalink
memcache server functions
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.caucho.com/resin/trunk@8487 9c94448d-38f1-0310-a231-d98308ff1ebf
  • Loading branch information
ferg committed Oct 13, 2011
1 parent 1ca460b commit 8f3ac0d
Show file tree
Hide file tree
Showing 6 changed files with 522 additions and 96 deletions.
131 changes: 80 additions & 51 deletions README
Expand Up @@ -6,15 +6,18 @@ This is the README file for Resin 4.0(tm)
The documentation included with Resin is in XTP format starting at The documentation included with Resin is in XTP format starting at
http://localhost:8080/resin-doc/index.xtp. http://localhost:8080/resin-doc/index.xtp.


The full documentation is also available online at For more information about configuring Resin, the full documentation is
http://www.caucho.com/resin-4.0/ if you have trouble getting started. also available online at:

http://www.caucho.com/resin-4.0/


Questions should go to our mailing list or forums. Questions should go to our mailing list or forums.


http://maillist.caucho.com -- mailing lists http://maillist.caucho.com -- mailing lists
http://forum.caucho.com -- forum http://forum.caucho.com -- forum
http://bugs.caucho.com -- bug reports http://bugs.caucho.com -- bug reports



I) Licensing/Support I) Licensing/Support
-------------------- --------------------


Expand All @@ -29,18 +32,21 @@ technical support options to fit your support and budget needs.


http://www.caucho.com/resin/sales -- licenses and support http://www.caucho.com/resin/sales -- licenses and support



II) Preconditions II) Preconditions
----------------- -----------------


1) Resin needs a Java JDK before it can run. Resin 4.0 works with 1) Resin needs a Java JDK before it can run. Resin 4.0 works with
JDK 1.6 or greater. JDK 1.6 or greater.


Some locations for JDKs include: Some locations for JDKs include:


Oracle: Oracle:
http://www.oracle.com/technetwork/java/javase/downloads/index.html http://www.oracle.com/technetwork/java/javase/downloads/index.html


2) On Windows, you'll need an unzip tool available at http://www.winzip.com 2) On Windows, you'll need an unzip tool available at http://www.winzip.com

3) A HTML 5 browser is needed for some features of the /resin-admin tool.


III) Getting Started III) Getting Started
-------------------- --------------------
Expand All @@ -49,67 +55,90 @@ The included HTTP/1.1 server makes it easy to evaluate Resin, JSP
and servlets. Just start it up. The default configuration and servlets. Just start it up. The default configuration
file is found in resin-4.0.x/conf/resin.xml. file is found in resin-4.0.x/conf/resin.xml.


1) On Unix, you'll want to build the JNI libraries: 1) On Unix, you'll want to build the JNI libraries:

resin-4.0.x> ./configure --prefix=`pwd`
resin-4.0.x> make
resin-4.0.x> make install

2) To start the server:

unix> bin/resin.sh start

or

C:\> java -jar lib/resin.jar start

The server listens to port 8080. Port 8080 is the default specified
in the configuration file resin-4.0.x/conf/resin.xml

Log files are in resin-4.0.x/log

3) Usually, Resin can find the JDK, but you may need to set JAVA_HOME in some
configurations.

Starting Resin with -verbose is a great way to see what environment
Resin is running.


resin-4.0.x> ./configure --prefix=`pwd` 4) Browse http://localhost:8080 or equivalently http://127.0.0.1:8080.
resin-4.0.x> make
resin-4.0.x> make install


2) To start the server: 5) Go through the documentation at http://localhost:8080/resin-doc


unix> java -jar lib/resin.jar start


or IV) Application Deployment
--------------------------


C:\> java -jar lib/resin.jar start 1) You can use the command-line to deploy a .war file:

unix> bin/resin.sh deploy foo.war


The server listens to port 8080. Port 8080 is the default specified 2) You can also copy the war file to the webapps directory.
in the configuration file resin-4.0.x/conf/resin.xml


3) Usually, Resin can find the JDK, but you may need to set JAVA_HOME in some To deploy a war file, place the file in resin-4.0.x/webapps/foo.war
configurations. Resin will expand the war file, and the application will be available
with the url http://localhost:8080/foo/


Starting Resin with -verbose is a great way to see what environment 3) Resin supports the development of applications without requiring a war
Resin is running. file deployment. Create a directory resin-4.0.x/webapps/bar to
correspond to url http://localhost:8080/bar/. Java source files
placed in resin-4.0.x/webapps/bar/WEB-INF/classes/ are automatically
compiled by Resin.


4) Browse http://localhost:8080 or equivalently http://127.0.0.1:8080. resin-4.0.x/webapps/bar/index.jsp
--> http://localhost:8080/bar/
--> http://localhost:8080/bar/index.jsp


5) Go through the documentation at http://localhost:8080/resin-doc resin-4.0.x/webapps/bar/WEB-INF/web.xml
-- servlet/jsp configuration file


6) For JSP, create test.jsp in resin-4.0.x/webapps/ROOT/test.jsp and browse resin-4.0.x/webapps/bar/WEB-INF/resin-web.xml
http://localhost:8080/test.jsp. -- Resin specific configuration


Resin serves files from resin-4.0.x/webapps/ROOT/ in the default resin-4.0.x/webapps/bar/WEB-INF/classes/example/HelloServlet.java
configuration. All files with the extension '.jsp' are interpreted -- java source file, automatically compiled by Resin
as jsp files.
4) For PHP, create test.php in resin-4.0.x/webapps/ROOT/test.php and browse
http://localhost:8080/test.php.


7) For PHP, create test.php in resin-4.0.x/webapps/ROOT/test.php and browse
http://localhost:8080/test.php.


8) To deploy a war file, place the file in resin-4.0.x/webapps/foo.war IV) PDF Reports
Resin will expand the war file, and the application will be available ---------------
with the url http://localhost:8080/foo/


Resin supports the development of applications without requiring a war With Resin-Pro, you can get a PDF snapshot report of the server with the
file deployment. Create a directory resin-4.0.x/webapps/bar to command-line:
correspond to url http://localhost:8080/bar/. Java source files
placed in resin-4.0.x/webapps/bar/WEB-INF/classes/ are automatically
compiled by Resin.


resin-4.0.x/webapps/bar/index.jsp unix> bin/resin.sh pdf-report
--> http://localhost:8080/bar/
--> http://localhost:8080/bar/index.jsp


resin-4.0.x/webapps/bar/WEB-INF/web.xml You can also get a watchdog restart report with the -watchdog option
-- servlet/jsp configuration file
unix> bin/resin.sh pdf-report -watchdog


resin-4.0.x/webapps/bar/WEB-INF/resin-web.xml
-- Resin specific configuration V) /resin-admin browser-based administration
--------------------------------------------


resin-4.0.x/webapps/bar/WEB-INF/classes/example/HelloServlet.java An administration application is available at
-- java source file, automatically compiled by Resin


9) An administration application is available at http://localhost:8080/resin-admin
http://localhost:8080/resin-admin
Instructions are provided for setting a password.


Instructions are provided for setting a password.
Expand Up @@ -341,9 +341,9 @@ public void put(Object key, Object value) throws CacheException
WriteStream out = client.getOutputStream(); WriteStream out = client.getOutputStream();
ReadStream is = client.getInputStream(); ReadStream is = client.getInputStream();


//TempStream ts = serialize(value); TempStream ts = serialize(value);
// long length = ts.getLength(); long length = ts.getLength();
long length = ((String) value).length(); // long length = ((String) value).length();


out.print("set "); out.print("set ");
out.print(key); out.print(key);
Expand All @@ -358,10 +358,10 @@ public void put(Object key, Object value) throws CacheException
out.print(length); out.print(length);
out.print("\r\n"); out.print("\r\n");


out.print(value); //out.print(value);
// ts.writeToStream(out); ts.writeToStream(out);


System.out.println("SET-LEN: " + length); // System.out.println("SET-LEN: " + length);


out.print("\r\n"); out.print("\r\n");
out.flush(); out.flush();
Expand Down

0 comments on commit 8f3ac0d

Please sign in to comment.