Permalink
Browse files

Added start and example scripts

  • Loading branch information...
Nigel Warren Nigel Warren
Nigel Warren authored and Nigel Warren committed Sep 20, 2013
1 parent 6c43c86 commit e910a5094982d189eb54514a8447170871a5933e
@@ -0,0 +1,2 @@
java -cp .\lib\FlyJava.jar com.zink.fly.example.WriteTake 1000
pause
@@ -0,0 +1,8 @@
#! /bin/sh
#
# Created on May 19, 2008, 8:18 AM
#
# Run the demo
#
java -server -cp ./lib/FlyJava.jar com.zink.fly.example.WriteTake 1000
@@ -18,7 +18,6 @@
package com.zink.fly.example;
/**
*
* @author nigel
*/
public class Ball {
@@ -20,12 +20,11 @@
import com.zink.fly.NotifyHandler;
/**
*
* @author nigel
*/
public class CallbackHandler implements NotifyHandler {
// This method is called on a spereate handler thread
// This method is called on a separate handler thread
public void templateMatched() {
System.out.println("Template Matched!");
}
@@ -19,7 +19,6 @@
/**
*
* @author nigel
*/
public class FlyEntry {
@@ -22,7 +22,6 @@
import com.zink.fly.kit.FlyFinder;
/**
*
* @author nigel
*/
@@ -15,6 +15,7 @@
*/
package com.zink.fly.example;
import com.zink.fly.FlyPrime;
@@ -18,7 +18,6 @@
package com.zink.fly.kit;
/**
*
* @author nigel
*/
public interface RequestHandler {
@@ -21,7 +21,6 @@
import java.nio.ByteBuffer;
public class ByteBufferInputStream extends java.io.InputStream {
/**
@@ -21,7 +21,6 @@
import java.lang.reflect.Modifier;
/**
*
* @author nigel
*/
public class FieldFilter {
@@ -18,7 +18,7 @@
// FieldInfo contains all of the information about the field that is within an entry
// So the EntryLayout simply becomes the holder of all of the fields meta info
// which currnetly is simply the type and the name
// which currently is simply the type and the name
//
public class FieldInfo {
@@ -21,6 +21,7 @@
import com.zink.fly.Notifiable;
import com.zink.fly.NotifyHandler;
import com.zink.fly.NotifyHandlerReturningEntry;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.HashMap;
@@ -37,11 +38,9 @@
static public final long NOTIFY_SIMPLE = -1L;
static public final long NOTIFY_WITH_OBJECT = -2L;
// Notify support with block message queue and 'token to handler' map
private Map<Long, ClientNotifyContext> notifyContextMap = new HashMap<Long, ClientNotifyContext>();
// Remove the blocking queue and set up the an Executor
ExecutorService threadPool = Executors.newCachedThreadPool();
@@ -64,7 +63,24 @@ void registerHandler(long notifyToken, Notifiable handler, Class clss ) {
void decodeAndQueue( long notifyMode, DataInputStream dis) throws IOException {
long notifyToken = dis.readLong();
// this can null ptr becuase the notify can happen while the register handler
// has not registered the token in the contextMap
// needs to be refactored becuase this is just a patch
ClientNotifyContext cnc = notifyContextMap.get(notifyToken);
if (cnc == null) {
// give the other thread a chance to register the notify handler
try {
Thread.sleep(10);
} catch (InterruptedException e) {
throw new FlyAccessException("Notify handler thread Interrupted");
}
// try again
cnc = notifyContextMap.get(notifyToken);
}
// if the above still fails this will null ptr
Notifiable handler = cnc.getHandler();
@@ -0,0 +1,2 @@
.\bin\Win32\i386\fly.exe
@@ -0,0 +1,39 @@
#! /bin/sh
#
# File: startFly.sh
# Created on May 19, 2008, 8:18 AM
#
# Start the fly server on the given OS and processor
#
#./bin/Linux/i386/fly &
#./bin/Linux/arm/fly &
#./bin/MacOSX/i386/fly &
#./bin/Solaris/i386/fly &
#
OS_NAME=UNKNOWN
ARCH=UNKNOWN
case `uname -s` in
(Darwin) OS_NAME=MacOSX;;
(Linux) OS_NAME=Linux;;
(SunOS) OS_NAME=Solaris
esac
case `uname -p` in
(i386) ARCH=i386;;
(powerpc) ARCH=ppc;;
(arm) ARCH=arm;;
(*) ARCH=i386;;
esac
echo $OS_NAME
echo $ARCH
if [ $OS_NAME = UNKNOWN ] || [ $ARCH = UNKNOWN ];
then echo Fly starter does not recognise `uname -s` `uname -p`
else
chmod +x ./bin/$OS_NAME/$ARCH/fly
./bin/$OS_NAME/$ARCH/fly $* &
fi
@@ -18,7 +18,7 @@
package com.zink.fly;
/**
* Like it is
* Like it is !
* @author nigel
*/
@@ -14,7 +14,6 @@
* limitations under the License.
*/
package com.zink.fly;
@@ -17,7 +17,6 @@
package com.zink.fly;
/**
*
* @author nigel
*/
public class SuperEntry extends TestEntry {
@@ -18,7 +18,6 @@
/**
*
* @author nigel
*/

0 comments on commit e910a50

Please sign in to comment.