1 16 17 package org.apache.jk.common; 18 19 import java.io.IOException ; 20 import java.io.RandomAccessFile ; 21 import java.nio.MappedByteBuffer ; 22 import java.nio.channels.FileChannel ; 23 24 import org.apache.jk.core.Msg; 25 import org.apache.jk.core.MsgContext; 26 import org.apache.tomcat.util.IntrospectionUtils; 27 28 33 public class Shm14 extends Shm { 34 35 36 38 private static org.apache.commons.logging.Log log= 39 org.apache.commons.logging.LogFactory.getLog( Shm14.class ); 40 41 MappedByteBuffer bb; 42 43 public void init() { 44 try { 45 RandomAccessFile f=new RandomAccessFile ( file, "rw" ); 46 FileChannel fc=f.getChannel(); 47 48 bb=fc.map( FileChannel.MapMode.READ_WRITE, 0, f.length()); 49 } catch( IOException ex ) { 50 ex.printStackTrace(); 51 } 52 } 53 54 public void dumpScoreboard(String file) { 55 bb.force(); 57 } 59 60 public void resetScoreboard() throws IOException { 61 } 63 64 65 public int invoke(Msg msg, MsgContext ep ) 66 throws IOException 67 { 68 if (log.isDebugEnabled()) 69 log.debug("ChannelShm14.invoke: " + ep ); 70 71 73 return 0; 74 } 75 76 public void initCli() { 77 } 78 79 public static void main( String args[] ) { 80 try { 81 Shm14 shm=new Shm14(); 82 83 if( args.length == 0 || 84 ( "-?".equals(args[0]) ) ) { 85 shm.setHelp( true ); 86 return; 87 } 88 89 IntrospectionUtils.processArgs( shm, args); 90 shm.execute(); 91 } catch( Exception ex ) { 92 ex.printStackTrace(); 93 } 94 } 95 96 } 97 | Popular Tags |