Mac OS X Reference Library Apple Developer
Search

WebJavaPlugIn Protocol Reference

(informal protocol)

Framework
/System/Library/Frameworks/WebKit.framework
Availability
Available in Mac OS X v10.3.9 and later.
Companion guide
Declared in
WebJavaPlugIn.h

Overview

The WebJavaPlugIn protocol provides methods to facilitate JNI access to the Java virtual machine via the plug-in.

Tasks

Getting and Setting Java Applets

Instance Methods

webPlugInCallJava:isStatic:returnType:method:arguments:callingURL:exceptionDescription:

Sends a message directly to a Java object in a plug-in.

- (jvalue)webPlugInCallJava:(jobject)objectisStatic:(BOOL)isStaticreturnType:(WebJNIReturnType)returnTypemethod:(jmethodID)methodarguments:(jvalue *)argscallingURL:(NSURL *)urlexceptionDescription:(NSString **)exceptionString

Parameters
object

The Java instance receiving the message.

isStatic

If YES, method is expected to be a class method.

returnType

The return type of the Java method.

method

The Java method being called.

args

The arguments for the method specified by method.

url

The URL for the page that contains the JavaScript that is interacting with Java.

exceptionString

A string for describing any exceptions thrown by Java. Pass nil if you do not want an exception description.

Return Value

The return value of the Java method.

Discussion

This method is preferred over using JNI to send messages to Java applets, and is required to guarantee the correct thread will receive the message. Always invoke this method from within the main thread.

Availability
  • Available in Mac OS X v10.3.9 and later.
Declared In
WebJavaPlugIn.h

webPlugInGetApplet

Returns a jobject that represents a Java applet in a WebPlugInContainer.

- (jobject)webPlugInGetApplet

Return Value

A jobject that represents the applet.

Discussion

Always invoke this method from within the main thread.

Availability
  • Available in Mac OS X v10.3.9 and later.
Declared In
WebJavaPlugIn.h

Constants

WebJNIReturnType

The return type of the Java method.

typedef enum {     WebJNIReturnTypeInvalid = 0,
   WebJNIReturnTypeVoid,
   WebJNIReturnTypeObject,
   WebJNIReturnTypeBoolean,
   WebJNIReturnTypeByte,
   WebJNIReturnTypeChar,
   WebJNIReturnTypeShort,
   WebJNIReturnTypeInt,
   WebJNIReturnTypeLong,
   WebJNIReturnTypeFloat,
   WebJNIReturnTypeDouble } WebJNIReturnType;
Constants
WebJNIReturnTypeInvalid

The return type is invalid.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeVoid

The return type is void.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeObject

The return type is an object.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeBoolean

The return type is a Boolean value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeByte

The return type is a byte value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeChar

The return type is a char value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeShort

The return type is a short value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeInt

The return type is an int value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeLong

The return type is a long value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeFloat

The return type is a float value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.

WebJNIReturnTypeDouble

The return type is a double value.

Available in Mac OS X v10.3 and later.

Declared in WebJavaPlugIn.h.




Last updated: 2010-02-24

Did this document help you? Yes It's good, but... Not helpful...