[][src]Struct j4rs::JvmBuilder

pub struct JvmBuilder<'a> { /* fields omitted */ }

A builder for Jvm

Methods

impl<'a> JvmBuilder<'a>[src]

pub fn new<'b>() -> JvmBuilder<'b>[src]

Creates a new JvmBuilder.

pub fn classpath_entry(
    &'a mut self,
    cp_entry: ClasspathEntry<'a>
) -> &'a mut JvmBuilder
[src]

Adds a classpath entry.

pub fn classpath_entries(
    &'a mut self,
    cp_entries: Vec<ClasspathEntry<'a>>
) -> &'a mut JvmBuilder
[src]

Adds classpath entries.

pub fn java_opt(&'a mut self, opt: JavaOpt<'a>) -> &'a mut JvmBuilder[src]

Adds a Java option.

pub fn java_opts(&'a mut self, opts: Vec<JavaOpt<'a>>) -> &'a mut JvmBuilder[src]

Adds Java options.

pub fn with_no_implicit_classpath(&'a mut self) -> &'a mut JvmBuilder[src]

By default, the created Jvms include an implicit classpath entry that includes the j4rs jar. When with_no_implicit_classpath() is called, this classpath will not be added to the Jvm.

pub fn detach_thread_on_drop(
    &'a mut self,
    detach_thread_on_drop: bool
) -> &'a mut JvmBuilder
[src]

When a Jvm goes out of scope and is being dropped, its current thread is being detached from the Java VM. A Jvm that is created with detach_thread_on_drop(false) will not detach the thread when being dropped.

This is useful when in the Java world a native method is called and in the native code someone needs to create a j4rs Jvm. Id that Jvm detaches its current thread when being dropped, there will be problems for the Java world code to continue executing.

pub fn with_native_lib_name(&'a mut self, lib_name: &str) -> &'a mut JvmBuilder[src]

In the case that the j4rs is statically linked to some other library, the Java world (j4rs.jar) needs to load that library instead of the default one.

This function defines the native library name to load.

pub fn skip_setting_native_lib(&'a mut self) -> &'a mut JvmBuilder[src]

Instructs the builder not to instruct the Java world j4rs code not to load the native library. (most probably because it is already loaded)

pub fn build(&self) -> Result<Jvm>[src]

Creates a Jvm

pub fn already_initialized() -> Result<Jvm>[src]

Creates a Jvm, similar with an already created j4rs Jvm.

Note: The already created Jvm is a j4rs Jvm, not a Java VM.

Auto Trait Implementations

impl<'a> Send for JvmBuilder<'a>

impl<'a> Sync for JvmBuilder<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.