Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java Setup functions



These Foundation functions can be called from Objective-C code; they can start the JVM and load classes.


Rob

---------------------------------8<-------------------------------
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Functions/FoundationFunctions.html#//apple_ref/doc/uid/ 20000055




Java Setup

NSJavaBundleCleanup

void NSJavaBundleCleanup(NSBundle *bundle, NSDictionary *plist)

Discussion

This function has been deprecated.

NSJavaBundleSetup

id NSJavaBundleSetup(NSBundle *bundle, NSDictionary *plist)

Discussion

This function has been deprecated.

NSJavaClassesForBundle

Loads the Java classes located in the specified bundle.

NSArray *NSJavaClassesForBundle(NSBundle *bundle, BOOL usesyscl, id *vm)

Discussion

Loads and returns the Java classes in the specified bundle. If the Java virtual machine is not loaded, load it first. A reference to the Java virtual machine is returned in the vm parameter. You can pass nil for the vm parameter if you do not want this information. Pass NO for usesyscl if you want to use a new instance of the class loader to load the classes; otherwise, the system can reuse an existing instance of the class loader. If you pass NO for usesyscl, the new class loader will be released when you are done with it; otherwise, the class loader will be cached for use next time.

NSJavaClassesFromPath

Loads the Java classes located at the specified path.

NSArray *NSJavaClassesFromPath(NSArray *path, NSArray *wanted, BOOL usesycl, id *vm)

Discussion

Loads and returns the Java classes in the specified bundle. If the Java virtual machine is not loaded, load it first. A reference to the Java virtual machine is returned in the vm parameter. You can pass nil for the vm parameter if you do not want this information. Pass an array of names of classes to load in the wanted parameter. If you pass nil for the wanted parameter, all classes at the specified path will be loaded. Pass NO for usesyscl if you want to use a new instance of the class loader to load the classes; otherwise, the system can reuse an existing instance of the class loader. If you pass NO for usesyscl, the new class loader will be released when you are done with it; otherwise, the class loader will be cached for use next time.

NSJavaNeedsToLoadClasses

Returns a Boolean value that indicates whether a virtual machine is needed or if Java classes are provided.

BOOL NSJavaNeedsToLoadClasses(NSDictionary *plist)

Discussion

Returns YES if a virtual machine is needed or if a virtual machine already exists and there’s an indication that Java classes are provided.

NSJavaNeedsVirtualMachine

Returns a Boolean value that indicates whether a Java virtual machine is required.

BOOL NSJavaNeedsVirtualMachine(NSDictionary *plist)

Discussion

Returns YES if plist contains a key saying that it requires Java.

NSJavaObjectNamedInPath

Creates an instance of the named class using the class loader previously specified at the given path.

id NSJavaObjectNamedInPath(NSString *name, NSArray *path)

Discussion

Returns a new instance of the class name. The class loader must be already be set up for the specified path (you can do this using a function such as NSJavaClassesFromPath).

NSJavaProvidesClasses

Returns a Boolean value that indicates whether Java classes are provided.

BOOL NSJavaProvidesClasses(NSDictionary *plist)

Discussion

Returns YES if plist contains an NSJavaPath key.

NSJavaSetup

Loads the Java virtual machine with specified parameters.

id NSJavaSetup(NSDictionary *plist)

Discussion

Part of the Java-to-Objective-C bridge. You normally shouldn’t use it yourself.

You can pass nil for the plist dictionary, in which case the Java virtual machine will not be loaded, so you should probably just use NSJavaSetupVirtualMachine instead. The plist dictionary may contain the following key-value pairs.

    *

NSJavaRoot—An NSString indicating the root of the location where the application’s classes are.
*


NSJavaPath—An NSArray of NSStrings, each string containing one component of a class path whose components will be prepended by NSJavaRoot if they are not absolute locations.
*


NSJavaUserPath—An NSString indicating another segment of the class path so that the application developer can customize where the class loader should search for classes. When searching for classes, this path is searched after the application’s class path so that one cannot replace the classes used by the application.
*


NSJavaLibraryPath—An NSArray of NSStrings, each string containing one component of a path to search for dynamic shared libraries needed by Java wrappers.
*


NSJavaClasses—An NSArray of NSStrings, each string containing the name of one class that the VM should load so that their associated frameworks will be loaded.


NSJavaSetupVirtualMachine

Sets up the Java virtual machine.

id NSJavaSetupVirtualMachine()

Discussion

Sets up and returns a reference to the Java virtual machine.

---------------------------------8<-------------------------------


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.