|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.platform.macosx.NativeInvocationBridge org.gudy.azureus2.platform.macosx.access.cocoa.CocoaJavaBridge
public final class CocoaJavaBridge
NOTE: This is only used for OSX 10.4 and non-up-to-date 10.5,10.6. OSX 10.5 Update 6 and OSX 10.6 Update 1 provides revealInFinder and moveToTrash functionality.
Performs PlatformManager tasks using Cocoa-Java (FoundationKit only)
For now, operations are performed using NSAppleScript, rather than using NSWorkspace. This is still significantly faster than calling the cmd-line osascript.
Field Summary | |
---|---|
protected static String |
CLASS_PATH
The path the Cocoa-Java class files are located at |
protected AEMonitor |
classMon
|
protected boolean |
isDisposed
|
protected org.gudy.azureus2.platform.macosx.access.cocoa.CocoaJavaBridge.RunnableDispatcher |
scriptDispatcher
|
Constructor Summary | |
---|---|
CocoaJavaBridge()
|
Method Summary | |
---|---|
protected void |
dispose()
Disposes system resources |
protected Object |
executeScript(String scriptFormat,
Object[] params)
Executes a new instance of NSAppleScript |
protected Object |
executeScriptWithAsync(String scriptFormat,
Object[] params)
Asynchronously executes a new instance of NSAppleScript |
protected Object |
executeScriptWithNewThread(String scriptFormat,
Object[] params)
Executes a new instance of NSAppleScript in a forked AEThread |
protected void |
finalize()
|
protected boolean |
isEnabled()
Gets whether the invocation bridge is available for use |
protected boolean |
performRecoverableFileDelete(File path)
|
protected boolean |
showInFinder(File path,
String fileBrowserApp)
|
Methods inherited from class org.gudy.azureus2.platform.macosx.NativeInvocationBridge |
---|
hasSharedInstance, sharedInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String CLASS_PATH
protected AEMonitor classMon
protected boolean isDisposed
protected org.gudy.azureus2.platform.macosx.access.cocoa.CocoaJavaBridge.RunnableDispatcher scriptDispatcher
Constructor Detail |
---|
public CocoaJavaBridge() throws Throwable
Throwable
Method Detail |
---|
protected boolean performRecoverableFileDelete(File path)
performRecoverableFileDelete
in class NativeInvocationBridge
PlatformManager#performRecoverableFileDelete(java.io.File)
protected boolean showInFinder(File path, String fileBrowserApp)
showInFinder
in class NativeInvocationBridge
PlatformManagerImpl.showInFinder(java.io.File)
protected boolean isEnabled()
Gets whether the invocation bridge is available for use
This method is used to anticipate scenarios such as where the bridge will fail due to missing classpaths
isEnabled
in class NativeInvocationBridge
protected final Object executeScript(String scriptFormat, Object[] params) throws Throwable
Executes a new instance of NSAppleScript
The method is wrapped in an autorelease pool and an AEMonitor. If there are no format parameters, MessageFormat is not used to parse the format string, and the format string will be treated as the source itself.
Throwable
MessageFormat.format(String, Object...)
,
NSAppleScript#execute(com.apple.cocoa.foundation.NSMutableDictionary)
protected final Object executeScriptWithNewThread(String scriptFormat, Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
Executes a new instance of NSAppleScript in a forked AEThread
This method always returns a "true" event descriptor. Callbacks are currently unsupported , so in the event of an error, the logger is autuomatically notified.
The thread's runSupport method is wrapped in an autorelease pool. If there are no format parameters, MessageFormat is not used to parse the format string, and the format string will be treated as the source itself.
InvocationTargetException
IllegalAccessException
IllegalArgumentException
AEThread.runSupport()
,
MessageFormat.format(String, Object...)
,
NSAppleScript#execute(com.apple.cocoa.foundation.NSMutableDictionary)
protected final Object executeScriptWithAsync(String scriptFormat, Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
Asynchronously executes a new instance of NSAppleScript
This method always returns a "true" event descriptor. Callbacks are currently unsupported , so in the event of an error, the logger is autuomatically notified.
The thread's runSupport method is wrapped in an autorelease pool. If there are no format parameters, MessageFormat is not used to parse the format string, and the format string will be treated as the source itself.
InvocationTargetException
IllegalAccessException
IllegalArgumentException
AEThread.runSupport()
,
MessageFormat.format(String, Object...)
,
NSAppleScript#execute(com.apple.cocoa.foundation.NSMutableDictionary)
protected void dispose()
dispose
in class NativeInvocationBridge
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |