org.jruby.ext.ffi.jna
Class JNAFactory

java.lang.Object
  extended by org.jruby.ext.ffi.Factory
      extended by org.jruby.ext.ffi.jna.JNAFactory

public class JNAFactory
extends Factory

An implementation of FFI for JNA


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.ext.ffi.Factory
Factory.Service
 
Constructor Summary
JNAFactory()
           
 
Method Summary
 Platform getPlatform()
          Gets the platform info for this FFIProvider.
 void init(Ruby runtime, RubyModule ffi)
          Registers FFI ruby classes/modules
<T> T
loadLibrary(java.lang.String libraryName, java.lang.Class<T> libraryClass)
          Loads a native library.
 java.nio.channels.ByteChannel newByteChannel(int fd)
          Wraps a java.nio.ByteChannel around a native file descriptor
protected  FFIProvider newProvider(Ruby runtime)
           
 
Methods inherited from class org.jruby.ext.ffi.Factory
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNAFactory

public JNAFactory()
Method Detail

init

public void init(Ruby runtime,
                 RubyModule ffi)
Description copied from class: Factory
Registers FFI ruby classes/modules

Overrides:
init in class Factory

newProvider

protected FFIProvider newProvider(Ruby runtime)
Specified by:
newProvider in class Factory

loadLibrary

public <T> T loadLibrary(java.lang.String libraryName,
                         java.lang.Class<T> libraryClass)
Description copied from class: Factory
Loads a native library.

Specified by:
loadLibrary in class Factory
Parameters:
libraryName - The name of the library to load.
libraryClass - The interface class to map to the library functions.
Returns:
A new instance of libraryClass that an access the library.

getPlatform

public Platform getPlatform()
Description copied from class: Factory
Gets the platform info for this FFIProvider.

Specified by:
getPlatform in class Factory
Returns:
A platform information instance.

newByteChannel

public java.nio.channels.ByteChannel newByteChannel(int fd)
Description copied from class: Factory
Wraps a java.nio.ByteChannel around a native file descriptor

Specified by:
newByteChannel in class Factory


Copyright © 2002-2007 JRuby Team. All Rights Reserved.