Fixed 71951, 74511, 74525
This commit is contained in:
idk%eng.sun.com 2001-04-03 11:57:15 +00:00
Родитель 1ec1eb04ba
Коммит 41fe7095a7
27 изменённых файлов: 176 добавлений и 1020 удалений

Просмотреть файл

@ -27,6 +27,6 @@ srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS= xpidl src loader classes components
DIRS= xpidl src loader import classes components test
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,42 @@
/* -*- Mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Sun Microsystems,
* Inc. Portions created by Sun are
* Copyright (C) 1999 Sun Microsystems, Inc. All
* Rights Reserved.
*
* Contributor(s):
* Igor Kushnirskiy <idk@eng.sun.com>
*/
package org.mozilla.xpcom;
public class CID extends ID {
public CID(String cid) {
super(cid);
}
public boolean equals(Object obj) {
if (! (obj instanceof CID)) {
return false;
}
boolean res = id.equals(((CID)obj).id);
return res;
}
protected String getPrefixForToString() {
return "org.mozilla.xpcom.CID@";
}
}

Просмотреть файл

@ -0,0 +1,53 @@
/* -*- Mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Sun Microsystems,
* Inc. Portions created by Sun are
* Copyright (C) 1999 Sun Microsystems, Inc. All
* Rights Reserved.
*
* Contributor(s):
* Igor Kushnirskiy <idk@eng.sun.com>
*/
package org.mozilla.xpcom;
public class ID {
public ID(String id) {
this.id = ((id == null) ? "" : id).toLowerCase();;
}
public boolean equals(Object obj) {
if (! (obj instanceof IID)) {
return false;
}
boolean res = id.equals(((ID)obj).id);
return res;
}
public String toString() {
return getPrefixForToString()+id;
}
public int hashCode() {
int h = id.hashCode();
return h;
}
public String getString() {
return id;
}
protected String id;
protected String getPrefixForToString() {
return "org.mozilla.xpcom.ID@";
}
}

Просмотреть файл

@ -21,37 +21,21 @@
*/
package org.mozilla.xpcom;
public class IID {
public class IID extends ID {
public IID(String iid) {
this.iid = ((iid == null) ? "" : iid).toLowerCase();;
super(iid);
}
public boolean equals(Object obj) {
if (! (obj instanceof IID)) {
return false;
}
boolean res = iid.equals(((IID)obj).iid);
boolean res = id.equals(((IID)obj).id);
return res;
}
public String toString() {
return "org.mozilla.xpcom.IID@"+iid;
protected String getPrefixForToString() {
return "org.mozilla.xpcom.IID@";
}
public int hashCode() {
int h = iid.hashCode();
return h;
}
public String getString() {
return iid;
}
private String iid;
public static Class TYPE;
static {
try {
TYPE = Class.forName("org.mozilla.xpcom.Proxy");
} catch (Exception e) { //it could not happen
TYPE = null;
}
}
}

Просмотреть файл

@ -86,12 +86,12 @@ public class InterfaceRegistry {
private static Hashtable registerInterfaces(Class cl) {
try {
Object iidStr = cl.getField(IID_STRING).get(cl);
if (iidStr instanceof String) {
IID iid = new IID((String)iidStr);
Object iidTmp = cl.getField(IID_STRING).get(cl);
if (iidTmp instanceof IID) {
IID iid = (IID)iidTmp;
// if this iface hasn't been registered, yet
if (interfaces.get(iid) == null) {
String[] methodNames = Utilities.getInterfaceMethodNames((String)iidStr);
String[] methodNames = Utilities.getInterfaceMethodNames(iid.getString());
if (methodNames != null) {
Method[] rmethods = new Method[methodNames.length];
Class[] ifaces = cl.getInterfaces();

Просмотреть файл

@ -1,330 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsIComponentManager.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsIComponentManager
*
* IID: 0x8458a740-d5dc-11d2-92fb-00e09805570f
*/
public interface nsIComponentManager extends nsISupports
{
public static final String IID =
"8458a740-d5dc-11d2-92fb-00e09805570f";
/**
* findFactory
*
* Returns the factory object that can be used to create instances of
* CID aClass
*
* @param aClass The classid of the factory that is being requested
*/
/* nsIFactory findFactory (in nsCIDRef aClass); */
public nsIFactory findFactory(IID aClass);
/**
* getClassObject
*
* @param aClass : CID of the class whose class object is requested
* @param aIID : IID of an interface that the class object is known to
* to implement. nsISupports and nsIFactory are known to
* be implemented by the class object.
*/
/**
* contractIDToClassID
*
* Get the ClassID for a given ContractID. Many ClassIDs may implement a
* ContractID. In such a situation, this returns the preferred ClassID, which
* happens to be the last registered ClassID.
*
* @param aContractID : Contractid for which ClassID is requested
* @return aClass : ClassID return
*/
/**
* classIDToContractid
*
* Get the ContractID for a given ClassID. A ClassIDs may implement multiple
* ContractIDs. This function return the last registered ContractID.
*
* @param aClass : ClassID for which ContractID is requested.
* @return aClassName : returns class name asssociated with aClass
* @return : ContractID last registered for aClass
*/
/* string CLSIDToContractID (in nsCIDRef aClass, out string aClassName); */
public String cLSIDToContractID(IID aClass, String[] aClassName);
/**
* createInstance
*
* Create an instance of the CID aClass and return the interface aIID.
*
* @param aClass : ClassID of object instance requested
* @param aDelegate : Used for aggregation
* @param aIID : IID of interface requested
*/
/**
* createInstanceByContractID
*
* Create an instance of the CID that implements aContractID and return the
* interface aIID. This is a convenience function that effectively does
* ContractIDToClassID() followed by CreateInstance().
*
* @param aContractID : aContractID of object instance requested
* @param aDelegate : Used for aggregation
* @param aIID : IID of interface requested
*/
/**
* registryLocationForSpec
*
* Given a file specification, return the registry representation of
* the filename. Files that are found relative to the components
* directory will have a registry representation
* "rel:<relative-native-path>" while filenames that are not, will have
* "abs:<full-native-path>".
*/
/* string registryLocationForSpec (in nsIFile aSpec); */
public String registryLocationForSpec(nsIFile aSpec);
/**
* specForRegistyLocation
*
* Create a file specification for the registry representation (rel:/abs:)
* got via registryLocationForSpec.
*/
/* nsIFile specForRegistryLocation (in string aLocation); */
public nsIFile specForRegistryLocation(String aLocation);
/**
* registerFactory
*
* Register a factory and ContractID associated with CID aClass
*
* @param aClass : CID of object
* @param aClassName : Class Name of CID
* @param aContractID : ContractID associated with CID aClass
* @param aFactory : Factory that will be registered for CID aClass
* @param aReplace : Boolean that indicates whether to replace a previous
* registration for the CID aClass.
*/
/* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory, in boolean aReplace); */
public void registerFactory(IID aClass, String aClassName, String aContractID, nsIFactory aFactory, boolean aReplace);
/**
* registerComponent
*
* Register a native dll module via its registry representation as returned
* by registryLocationForSpec() as the container of CID implemenation
* aClass and associate aContractID and aClassName to the CID aClass. Native
* dll component type is assumed.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aLocation : Location of module (dll). Format of this is the
* registry representation as returned by
* registryLocationForSpec()
* @param aReplace : Boolean that indicates whether to replace a previous
* module registration for aClass.
* @param aPersist : Remember this registration across sessions.
*/
/* void registerComponent (in nsCIDRef aClass, in string aClassName, in string aContractID, in string aLocation, in boolean aReplace, in boolean aPersist); */
public void registerComponent(IID aClass, String aClassName, String aContractID, String aLocation, boolean aReplace, boolean aPersist);
/**
* registerComponentWithType
*
* Register a module's location via its registry representation
* as returned by registryLocationForSpec() as the container of CID implemenation
* aClass of type aType and associate aContractID and aClassName to the CID aClass.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aSpec : Filename spec for module's location.
* @param aLocation : Location of module of type aType. Format of this string
* is the registry representation as returned by
* registryLocationForSpec()
* @param aReplace : Boolean that indicates whether to replace a previous
* loader registration for aClass.
* @param aPersist : Remember this registration across sessions.
* @param aType : Component Type of CID aClass.
*/
/* void registerComponentWithType (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aSpec, in string aLocation, in boolean aReplace, in boolean aPersist, in string aType); */
public void registerComponentWithType(IID aClass, String aClassName, String aContractID, nsIFile aSpec, String aLocation, boolean aReplace, boolean aPersist, String aType);
/**
* registerComponentSpec
*
* Register a native dll module via its file specification as the container
* of CID implemenation aClass and associate aContractID and aClassName to the
* CID aClass. Native dll component type is assumed.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aLibrary : File specification Location of module (dll).
* @param aReplace : Boolean that indicates whether to replace a previous
* module registration for aClass.
* @param aPersist : Remember this registration across sessions.
*/
/* void registerComponentSpec (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aLibrary, in boolean aReplace, in boolean aPersist); */
public void registerComponentSpec(IID aClass, String aClassName, String aContractID, nsIFile aLibrary, boolean aReplace, boolean aPersist);
/**
* registerComponentLib
*
* Register a native dll module via its dll name (not full path) as the
* container of CID implemenation aClass and associate aContractID and aClassName
* to the CID aClass. Native dll component type is assumed and the system
* services will be used to load this dll.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aDllNameLocation : Dll name of module.
* @param aReplace : Boolean that indicates whether to replace a previous
* module registration for aClass.
* @param aPersist : Remember this registration across sessions.
*/
/* void registerComponentLib (in nsCIDRef aClass, in string aClassName, in string aContractID, in string aDllName, in boolean aReplace, in boolean aPersist); */
public void registerComponentLib(IID aClass, String aClassName, String aContractID, String aDllName, boolean aReplace, boolean aPersist);
/**
* unregisterFactory
*
* Unregister a factory associated with CID aClass.
*
* @param aClass : ClassID being unregistered
* @param aFactory : Factory previously registered to create instances of
* ClassID aClass.
*/
/* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
public void unregisterFactory(IID aClass, nsIFactory aFactory);
/**
* unregisterComponent
*
* Disassociate module aLocation represented as registry location as returned
* by registryLocationForSpec() as containing ClassID aClass.
*
* @param aClass : ClassID being unregistered
* @param aLocation : Location of module. Format of this is the registry
* representation as returned by registryLocationForSpec().
* Components of any type will be unregistered.
*/
/* void unregisterComponent (in nsCIDRef aClass, in string aLocation); */
public void unregisterComponent(IID aClass, String aLocation);
/**
* unregisterComponentSpec
*
* Disassociate module references by file specification aLibrarySpec as
* containing ClassID aClass.
*/
/* void unregisterComponentSpec (in nsCIDRef aClass, in nsIFile aLibrarySpec); */
public void unregisterComponentSpec(IID aClass, nsIFile aLibrarySpec);
/**
* freeLibraries
*
* Enumerates all loaded modules and unloads unused modules.
*/
/* void freeLibraries (); */
public void freeLibraries();
/**
* ID values for 'when'
*/
/* const long NS_Startup = 0; */
public static final int NS_Startup = 0;
/* const long NS_Script = 1; */
public static final int NS_Script = 1;
/* const long NS_Timer = 2; */
public static final int NS_Timer = 2;
/* const long NS_Shutdown = 3; */
public static final int NS_Shutdown = 3;
/**
* autoRegister
*
* Enumerates directory looking for modules of all types and registers
* modules who have changed (modtime or size) since the last time
* autoRegister() was invoked.
*
* @param when : ID values of when the call is being made.
* @param directory : Directory the will be enumerated.
*/
/* void autoRegister (in long when, in nsIFile directory); */
public void autoRegister(int when, nsIFile directory);
/**
* autoRegisterComponent
*
* Loads module using appropriate loader and gives it an opportunity to
* register its CIDs if module's modtime or size changed since the last
* time this was called.
*
* @param when : ID values of when the call is being made.
* @param aFileLocation : File specification of module.
*/
/* void autoRegisterComponent (in long when, in nsIFile aFileLocation); */
public void autoRegisterComponent(int when, nsIFile aFileLocation);
/**
* autoUnregisterComponent
*
* Loads module using approriate loader and gives it an opportunity to
* unregister its CIDs
*/
/* void autoUnregisterComponent (in long when, in nsIFile aFileLocation); */
public void autoUnregisterComponent(int when, nsIFile aFileLocation);
/**
* isRegistered
*
* Returns true if a factory or module is registered for CID aClass.
*
* @param aClass : ClassID queried for registeration
* @return : true if a factory or module is registered for CID aClass.
* false otherwise.
*/
/* boolean isRegistered (in nsCIDRef aClass); */
public boolean isRegistered(IID aClass);
/**
* enumerateCLSIDs
*
* Enumerate the list of all registered ClassIDs.
*
* @return : enumerator for ClassIDs.
*/
/* nsIEnumerator enumerateCLSIDs (); */
public nsIEnumerator enumerateCLSIDs();
/**
* enumerateContractIDs
*
* Enumerate the list of all registered ContractIDs.
*
* @return : enumerator for ContractIDs.
*/
/* nsIEnumerator enumerateContractIDs (); */
public nsIEnumerator enumerateContractIDs();
}
/*
* end
*/

Просмотреть файл

@ -1,49 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsIEnumerator.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsIEnumerator
*
* IID: 0xad385286-cbc4-11d2-8cca-0060b0fc14a3
*/
public interface nsIEnumerator extends nsISupports
{
public static final String IID =
"ad385286-cbc4-11d2-8cca-0060b0fc14a3";
/** First will reset the list. will return NS_FAILED if no items
*/
/* void first (); */
public void first();
/** Next will advance the list. will return failed if already at end
*/
/* void next (); */
public void next();
/** CurrentItem will return the CurrentItem item it will fail if the
* list is empty
*/
/* nsISupports currentItem (); */
public nsISupports currentItem();
/** return if the collection is at the end. that is the beginning following
* a call to Prev and it is the end of the list following a call to next
*/
/* void isDone (); */
public void isDone();
}
/*
* end
*/

Просмотреть файл

@ -1,33 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsIFactory.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsIFactory
*
* IID: 0x00000001-0000-0000-c000-000000000046
*/
public interface nsIFactory extends nsISupports
{
public static final String IID =
"00000001-0000-0000-c000-000000000046";
/* void createInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
public Object createInstance(nsISupports aOuter, IID iid);
/* void lockFactory (in PRBool lock); */
public void lockFactory(boolean lock);
}
/*
* end
*/

Просмотреть файл

@ -1,365 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsIFile.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsIFile
*
* IID: 0xc8c0a080-0868-11d3-915f-d9d889d48e3c
*/
public interface nsIFile extends nsISupports
{
public static final String IID =
"c8c0a080-0868-11d3-915f-d9d889d48e3c";
/**
* Create Types
*
* NORMAL_FILE_TYPE - A normal file.
* DIRECTORY_TYPE - A directory/folder.
*/
/* const unsigned long NORMAL_FILE_TYPE = 0; */
public static final int NORMAL_FILE_TYPE = 0;
/* const unsigned long DIRECTORY_TYPE = 1; */
public static final int DIRECTORY_TYPE = 1;
/**
* appendPath
*
* This function is used for constructing a descendant of the
* current nsIFile.
*
* @param relativePath
* A string which is intented to be a child node of the
* nsIFile.
*/
/* void append ([const] in string node); */
public void append(String node);
/* void appendUnicode ([const] in wstring node); */
public void appendUnicode(String node);
/**
* Normalize the pathName (e.g. removing .. and . components on Unix).
*/
/* void normalize (); */
public void normalize();
/**
* create
*
* This function will create a new file or directory in the
* file system. Any nodes that have not been created or
* resolved, will be. If the file or directory already
* exists create() will return NS_ERROR_FILE_ALREADY_EXISTS.
*
* @param type
* This specifies the type of file system object
* to be made. The only two types at this time
* are file and directory which are defined above.
* If the type is unrecongnized, we will return an
* error (NS_ERROR_FILE_UNKNOWN_TYPE).
*
* @param permissions
* The unix style octal permissions. This may
* be ignored on systems that do not need to do
* permissions.
*/
/* void create (in unsigned long type, in unsigned long permissions); */
public void create(int type, int permissions);
/**
* Accessor to the leaf name of the file itself.
*/
/* attribute string leafName; */
public String getLeafName();
public void setLeafName(String value);
/* attribute wstring unicodeLeafName; */
public String getUnicodeLeafName();
public void setUnicodeLeafName(String value);
/**
* copyTo
*
* This will copy this file to the specified newParentDir.
* If a newName is specified, the file will be renamed.
* If 'this' is not created we will return an error
* (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST).
*
* copyTo will NOT resolve aliases/shortcuts during the copy.
*
* @param newParentDir
* This param is the destination directory. If the
* newParentDir is null, copyTo() will use the parent
* directory of this file. If the newParentDir is not
* null and is not a directory, an error will be
* returned (NS_ERROR_FILE_DESTINATION_NOT_DIR)
*
* @param newName
* This param allows you to specify a new name for
* the file to be copied. This param may be null, in
* which case the current leaf name will be used.
*
*/
/* void copyTo (in nsIFile newParentDir, [const] in string newName); */
public void copyTo(nsIFile newParentDir, String newName);
/* void copyToUnicode (in nsIFile newParentDir, [const] in wstring newName); */
public void copyToUnicode(nsIFile newParentDir, String newName);
/**
* copyToFollowingLinks
*
* This function is identical to copyTo except it, as
* the name implies, follows symbolic links. Some OSes
* such as Unix and Linux always follow symbolic links
* when copying.
*/
/* void copyToFollowingLinks (in nsIFile newParentDir, [const] in string newName); */
public void copyToFollowingLinks(nsIFile newParentDir, String newName);
/* void copyToFollowingLinksUnicode (in nsIFile newParentDir, [const] in wstring newName); */
public void copyToFollowingLinksUnicode(nsIFile newParentDir, String newName);
/**
* moveTo
*
* This will move this file to the specified newParentDir.
* If a newName is specified, the file will be renamed.
* If 'this' is not created we will return an error
* (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST).
*
* moveTo will NOT resolve aliases/shortcuts during the copy.
* moveTo will do the right thing and allow copies across
* volumes.
*
* @param newParentDir
* This param is the destination directory. If the
* newParentDir is null, moveTo() will rename the file
* within its current directory. If the newParentDir is
* not null and does not name a directory, an error will
* be returned (NS_ERROR_FILE_DESTINATION_NOT_DIR)
*
* @param newName
* This param allows you to specify a new name for
* the file to be moved. This param may be null, in
* which case the current leaf name will be used.
*
*/
/* void moveTo (in nsIFile newParentDir, [const] in string newName); */
public void moveTo(nsIFile newParentDir, String newName);
/* void moveToUnicode (in nsIFile newParentDir, [const] in wstring newName); */
public void moveToUnicode(nsIFile newParentDir, String newName);
/**
* This will try to execute this file. It will not block for
* execution. 'args' will be passed through on the command line
* if the OS supports that.
*/
/* void spawn ([array, size_is (count)] in string args, in unsigned long count); */
public void spawn(String[] args, int count);
/**
* This will try to delete this file. The 'recursive' flag
* must be PR_TRUE to delete directories which are not empty.
*
* This will not resolve any symlinks.
*/
/* void delete (in boolean recursive); */
public void delete(boolean recursive);
/**
* Attributes of nsIFile.
*/
/* attribute unsigned long permissions; */
public int getPermissions();
public void setPermissions(int value);
/* attribute unsigned long permissionsOfLink; */
public int getPermissionsOfLink();
public void setPermissionsOfLink(int value);
/**
* File Times are to be in milliseconds from
* midnight (00:00:00), January 1, 1970 Greenwich Mean
* Time (GMT).
*/
/* attribute PRInt64 lastModificationDate; */
public long getLastModificationDate();
public void setLastModificationDate(long value);
/* attribute PRInt64 lastModificationDateOfLink; */
public long getLastModificationDateOfLink();
public void setLastModificationDateOfLink(long value);
/**
* WARNING! On the Mac getting/setting the file size with nsIFile
* only deals with the size of the data fork. If you need to
* know the size of the combined data and resource forks use the
* GetFileSizeWithResFork() method defined in nsILocalFileMac.h
*/
/* attribute PRInt64 fileSize; */
public long getFileSize();
public void setFileSize(long value);
/* readonly attribute PRInt64 fileSizeOfLink; */
public long getFileSizeOfLink();
/**
* target & path
*
* Accessor to the string path. These strings are
* not guaranteed to be a usable path to pass to NSPR
* or the C stdlib. There are problems that affect
* platforms on which a path does not fully specify a
* file, because two volumes can have the same name.
* This is solved by holding "private", native data in
* the nsIFile implementation. This native data is lost
* when you convert to a string.
*
* DO NOT PASS TO USE WITH NSPR OR STDLIB.
*
* target:
* Find out what the symlink points at. Will give error
* (NS_ERROR_FILE_INVALID_PATH) if not a symlink.
*
* path:
* Find out what the nsIFile points at.
*/
/* readonly attribute string target; */
public String getTarget();
/* readonly attribute wstring unicodeTarget; */
public String getUnicodeTarget();
/* readonly attribute string path; */
public String getPath();
/* readonly attribute wstring unicodePath; */
public String getUnicodePath();
/* boolean exists (); */
public boolean exists();
/* boolean isWritable (); */
public boolean isWritable();
/* boolean isReadable (); */
public boolean isReadable();
/* boolean isExecutable (); */
public boolean isExecutable();
/* boolean isHidden (); */
public boolean isHidden();
/* boolean isDirectory (); */
public boolean isDirectory();
/* boolean isFile (); */
public boolean isFile();
/* boolean isSymlink (); */
public boolean isSymlink();
/**
* Not a regular file, not a directory, not a symlink.
*/
/* boolean isSpecial (); */
public boolean isSpecial();
/**
* createUnique
*
* This function will create a new file or directory in the
* file system. Any nodes that have not been created or
* resolved, will be. If this file already exists, we try
* variations on the leaf name "suggestedName" until we find
* one that did not already exist.
*
* If the search for nonexistent files takes too long
* (thousands of the variants already exist), we give up and
* return NS_ERROR_FILE_TOO_BIG.
*
* @param type
* This specifies the type of file system object
* to be made. The only two types at this time
* are file and directory which are defined above.
* If the type is unrecongnized, we will return an
* error (NS_ERROR_FILE_UNKNOWN_TYPE).
*
* @param permissions
* The unix style octal permissions. This may
* be ignored on systems that do not need to do
* permissions.
*/
/* void createUnique (in string suggestedName, in unsigned long type, in unsigned long permissions); */
public void createUnique(String suggestedName, int type, int permissions);
/**
* clone()
*
* This function will allocate and initialize a nsIFile object to the
* exact location of the |this| nsIFile.
*
* @param file
* A nsIFile which this object will be initialize
* with.
*
*/
/* nsIFile clone (); */
/* public nsIFile clone(); */
/**
* Will determine if the inFile equals this.
*/
/* boolean equals (in nsIFile inFile); */
public boolean equals(nsIFile inFile);
/**
* Will determine if inFile is a descendant of this file
* If |recur| is true, look in subdirectories too
*/
/* boolean contains (in nsIFile inFile, in boolean recur); */
public boolean contains(nsIFile inFile, boolean recur);
/**
* Parent will be null when this is at the top of the volume.
*/
/* readonly attribute nsIFile parent; */
public nsIFile getParent();
/**
* Returns an enumeration of the elements in a directory. Each
* element in the enumeration is an nsIFile.
*
* @return NS_ERROR_FILE_NOT_DIRECTORY if the current nsIFile does
* not specify a directory.
*/
/* readonly attribute nsISimpleEnumerator directoryEntries; */
public nsISimpleEnumerator getDirectoryEntries();
/**
* Accesses the file: url for the nsIFile. Setting this causes the path
* to be reset.
*/
/* attribute string URL; */
public String getURL();
public void setURL(String value);
}
/*
* end
*/

Просмотреть файл

@ -1,33 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsIEnumerator.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsISimpleEnumerator
*
* IID: 0xD1899240-F9D2-11D2-BDD6-000064657374
*/
public interface nsISimpleEnumerator extends nsISupports
{
public static final String IID =
"D1899240-F9D2-11D2-BDD6-000064657374";
/* boolean hasMoreElements (); */
public boolean hasMoreElements();
/* nsISupports getNext (); */
public nsISupports getNext();
}
/*
* end
*/

Просмотреть файл

@ -1,30 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsISupports.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsISupports
*
* IID: 0x00000000-0000-0000-c000-000000000046
*/
public interface nsISupports
{
public static final String IID =
"00000000-0000-0000-c000-000000000046";
/* void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
public Object queryInterface(IID uuid);
}
/*
* end
*/

Просмотреть файл

@ -1,37 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from nsISupportsPrimitives.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsISupportsString
*
* IID: 0xd65ff270-4a1c-11d3-9890-006008962422
*/
public interface nsISupportsString extends nsISupports
{
public static final String IID =
"d65ff270-4a1c-11d3-9890-006008962422";
/* attribute string data; */
public String getData();
public void setData(String value);
/* string toString (); */
public String toString_();
/* void setDataWithLength (in unsigned long length, [size_is (length)] in string data); */
public void setDataWithLength(int length, String data);
}
/*
* end
*/

Просмотреть файл

@ -37,6 +37,7 @@ XPIDLSRCS = bcIBlackConnectInit.idl
CPPSRCS = bcBlackConnectInit.cpp
include $(topsrcdir)/config/rules.mk
include ../config/rules.mk
COMPONENT=bcBlackConnectInit
CLASSES=bcIBlackConnectInit.class bcBlackConnectInit.class
@ -44,7 +45,10 @@ CLASSES=bcIBlackConnectInit.class bcBlackConnectInit.class
$(COMPONENT).jar.comp: manifest $(CLASSES)
$(JDKHOME)/bin/jar cvfm $(COMPONENT).jar.comp manifest *.class
.java.class:
$(JDKHOME)/bin/javac -classpath .:../classes $<
$(JDKHOME)/bin/javac -classpath .:../classes:$(DIST)/classes $<
bcIBlackConnectInit.java : bcIBlackConnectInit.idl
install-component: $(COMPONENT).jar.comp $(COMPONENT).jar.info
cp $(COMPONENT).jar.comp $(COMPONENT).jar.info $(DEPTH)/dist/bin/components/
clobber-java:

Просмотреть файл

@ -26,8 +26,8 @@ public class bcBlackConnectInit implements bcIBlackConnectInit {
}
public Object queryInterface(IID iid) {
Object result;
if ( nsISupportsIID.equals(iid)
|| bcIBlackConnectInitIID.equals(iid)) {
if ( nsISupports.IID.equals(iid)
|| bcIBlackConnectInit.IID.equals(iid)) {
result = this;
} else {
result = null;
@ -39,9 +39,6 @@ public class bcBlackConnectInit implements bcIBlackConnectInit {
Components.setComponentManager(cm);
Debug.log("Components.setComponentManager(cm);");
}
static IID bcIBlackConnectInitIID = new IID(bcIBlackConnectInit.IID);
static IID nsISupportsIID = new IID(nsISupports.IID);
static {
InterfaceRegistry.register(nsIComponentManager.class);
}

Просмотреть файл

@ -1,6 +1,7 @@
#include "nsISupports.idl"
#include "nsIComponentManager.idl"
#pragma prefix
[scriptable, uuid(d4867a7e-1dd1-11b2-a009-b111ab5d7639)]
interface bcIBlackConnectInit : nsISupports

Просмотреть файл

@ -1,30 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from bcIBlackConnectInit.idl.
*/
import org.mozilla.xpcom.*;
/**
* Interface bcIBlackConnectInit
*
* IID: 0xd4867a7e-1dd1-11b2-a009-b111ab5d7639
*/
public interface bcIBlackConnectInit extends nsISupports
{
public static final String IID =
"d4867a7e-1dd1-11b2-a009-b111ab5d7639";
/* void initComponentManager (in nsIComponentManager cm); */
public void initComponentManager(nsIComponentManager cm);
}
/*
* end
*/

Просмотреть файл

@ -41,6 +41,7 @@ OBJS = .\$(OBJDIR)\bcBlackConnectInit.obj
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
include ..\config\rules.mak
COMPONENT=bcBlackConnectInit
CLASSES=bcIBlackConnectInit.class bcBlackConnectInit.class
@ -51,7 +52,9 @@ $(COMPONENT).jar.comp: manifest $(CLASSES)
.SUFFIXES: .java .class
.java.class:
$(JDKHOME)\bin\javac -classpath .;..\classes $<
$(JDKHOME)\bin\javac -classpath .;..\classes;$(DEPTH)\dist\classes $<
bcIBlackConnectInit.java : bcIBlackConnectInit.idl
install-component: $(COMPONENT).jar.comp $(COMPONENT).jar.info $(DLL)
copy $(COMPONENT).jar* $(DIST)\bin\components

Просмотреть файл

@ -454,14 +454,12 @@ UnregisterJavaLoader(nsIComponentManager *aCompMgr, nsIFile *aPath,
NS_GENERIC_FACTORY_CONSTRUCTOR(bcJavaComponentLoader);
static nsModuleComponentInfo components[] = {
static nsModuleComponentInfo components_loader[] = {
{ "Java component loader", BC_JAVACOMPONENTLOADER_CID,
BC_JAVACOMPONENTLOADER_ContractID,
bcJavaComponentLoaderConstructor,
RegisterJavaLoader, UnregisterJavaLoader },
};
NS_IMPL_NSGETMODULE("Java component loader", components);
NS_IMPL_NSGETMODULE("Java component loader", components_loader);

Просмотреть файл

@ -27,6 +27,7 @@ DIRS= \
xpidl \
loader \
src \
import \
classes \
# test \
components \

Просмотреть файл

@ -47,13 +47,33 @@ static nsModuleComponentInfo components[] =
{
{
"Black Connect Java stubs and proxies",
BC_JAVASTUBSANDPROXIES_CID,
BC_JAVASTUBSANDPROXIES_PROGID,
BC_JAVASTUBSANDPROXIES_CID,
BC_JAVASTUBSANDPROXIES_ContractID,
bcJavaStubsAndProxiesConstructor
}
};
NS_IMPL_NSGETMODULE("BlackConnect Java stubs and proxies",components);
//NS_IMPL_NSGETMODULE("BlackConnect Java stubs and proxies",components_stubs);
PRUint32 NSGetModule_components_count =
sizeof(components) / sizeof(components[0]);
nsModuleComponentInfo* NSGetModule_components_idk = (components);
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
nsIFile* location,
nsIModule** result)
{
return NS_NewGenericModule("BlackConnect Java stubs and proxies",
NSGetModule_components_count,
NSGetModule_components_idk,
nsnull, result);
}
NS_IMPL_ISUPPORTS(bcJavaStubsAndProxies,NS_GET_IID(bcJavaStubsAndProxies));
@ -81,10 +101,14 @@ public:
bcJavaStubsAndProxies::bcJavaStubsAndProxies() {
NS_INIT_REFCNT();
PR_LOG(bcJavaGlobal::GetLog(),PR_LOG_DEBUG,
("--[c++] bcJavaStubsAndProxies::bcJavaStubsAndProxies\n"));
oid2objectMap = new nsHashtable(256,PR_TRUE);
}
bcJavaStubsAndProxies::~bcJavaStubsAndProxies() {
PR_LOG(bcJavaGlobal::GetLog(),PR_LOG_DEBUG,
("--[c++] bcJavaStubsAndProxies::~bcJavaStubsAndProxies\n"));
delete oid2objectMap;
}

Просмотреть файл

@ -33,7 +33,7 @@
{0x58034ea6, 0x1dd2, 0x11b2, \
{0x9b, 0x58, 0x86, 0x30, 0xab, 0xb8, 0xaf,0x47}}
#define BC_JAVASTUBSANDPROXIES_PROGID "component://netscape/blackwood/blackconnect/java-stubs-and-proxies"
#define BC_JAVASTUBSANDPROXIES_ContractID "@mozilla.org/blackwood/blackconnect/java-stubs-and-proxies"
/* 7cadf6e8-1dd2-11b2-9a6e-b1c37844e004 */
#define BC_JAVASTUBSANDPROXIES_CID \

Просмотреть файл

@ -36,11 +36,15 @@ XPIDL_MODULE = javaSample
XPIDLSRCS = bcIJavaSample.idl
CPPSRCS = bcJavaSample.cpp
include $(topsrcdir)/config/rules.mk
include ../config/rules.mk
bcJavaSample.jar.comp: manifest bcIJavaSample.class bcJavaSample.class
$(JDKHOME)/bin/jar cvfm bcJavaSample.jar.comp manifest *.class
.java.class:
$(JDKHOME)/bin/javac -classpath .:../classes $<
$(JDKHOME)/bin/javac -classpath .:../classes:$(DIST)/classes $<
bcIJavaSample.java : bcIJavaSample.idl
install-component: bcJavaSample.jar.comp bcJavaSample.jar.info
cp bcJavaSample.jar.comp bcJavaSample.jar.info $(DEPTH)/dist/bin/components/

Просмотреть файл

@ -1,6 +1,7 @@
#include "nsISupports.idl"
#include "nsIComponentManager.idl"
#pragma prefix
[scriptable, uuid(ca1e2656-1dd1-11b2-9c4e-f49ea557abde)]
interface bcIJavaSample : nsISupports
{

Просмотреть файл

@ -1,51 +0,0 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from bcIJavaSample.idl.
*/
import org.mozilla.xpcom.*;
/**
* Interface bcIJavaSample
*
* IID: 0xca1e2656-1dd1-11b2-9c4e-f49ea557abde
*/
public interface bcIJavaSample extends nsISupports
{
public static final String IID =
"ca1e2656-1dd1-11b2-9c4e-f49ea557abde";
/* void test0 (); */
public void test0();
/* void test1 (in long l); */
public void test1(int l);
/* void test2 (in bcIJavaSample o); */
public void test2(bcIJavaSample o);
/* void test3 (in PRUint32 count, [array, size_is (count)] in long valueArray); */
public void test3(int count, int[] valueArray);
/* void test4 (in PRUint32 count, [array, size_is (count)] inout string valueArray); */
public void test4(int count, String[][] valueArray);
/* void test5 (in nsIComponentManager cm); */
public void test5(nsIComponentManager cm);
/* void test6 (in PRUint32 count, [array, size_is (count)] in string valueArray); */
public void test6(int count, String[] valueArray);
/* void test7 (out PRUint32 count, [array, size_is (count)] out char valueArray); */
public void test7(int[] count, char[][] valueArray);
}
/*
* end
*/

Просмотреть файл

@ -29,8 +29,8 @@ public class bcJavaSample implements bcIJavaSample {
public Object queryInterface(IID iid) {
System.out.println("--[java]bcJavaSample::queryInterface iid="+iid);
Object result;
if ( iid.equals(nsISupportsIID)
|| iid.equals(bcIJavaSampleIID)) {
if ( iid.equals(nsISupports.IID)
|| iid.equals(bcIJavaSample.IID)) {
result = this;
} else {
result = null;
@ -99,7 +99,7 @@ public class bcJavaSample implements bcIJavaSample {
|| counter > 300) {
break;
}
strObj = (nsISupportsString) obj.queryInterface(nsISupportsStringIID);
strObj = (nsISupportsString) obj.queryInterface(nsISupportsString.IID);
str = strObj.getData();
System.out.println("--[java] bcJavaSample.Test5 string "+str);
enumerator.next(); counter++;
@ -124,11 +124,6 @@ public class bcJavaSample implements bcIJavaSample {
count[0] = retValue.length;
valueArray[0] = retValue;
}
static IID bcIJavaSampleIID = new IID(bcIJavaSample.IID);
static IID nsISupportsIID = new IID(nsISupports.IID);
static IID nsIComponenstManagerIID = new IID(nsIComponentManager.IID);
static IID nsISupportsStringIID = new IID(nsISupportsString.IID);
static {
try {
Class nsIComponentManagerClass =

Просмотреть файл

@ -41,14 +41,16 @@ OBJS = .\$(OBJDIR)\bcJavaSample.obj
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
include ..\config\rules.mak
bcJavaSample.jar.comp: manifest bcIJavaSample.class bcJavaSample.class
$(JDKHOME)\bin\jar cvfm bcJavaSample.jar.comp manifest *.class
.SUFFIXES: .java .class
.java.class:
$(JDKHOME)\bin\javac -classpath .;..\classes $<
$(JDKHOME)\bin\javac -classpath .;..\classes;$(DEPTH)\dist\classes $<
bcIJavaSample.java : bcIJavaSample.idl
install-component: bcJavaSample.jar.comp bcJavaSample.jar.info $(DLL)
copy bcJavaSample.jar* $(DIST)\bin\components
@ -60,4 +62,4 @@ clobber:: clobber-java
rm -f "$(DIST)\bin\components\$(DLLNAME).dll"
rm -f "$(DIST)\bin\components\bcJavaSample.jar.*"
clobber_all:: clobber-java
install:: install-component
install:: install-component

Просмотреть файл

@ -20,6 +20,8 @@
* Contributor(s):
* Michael Allen (michael.allen@sun.com)
* Frank Mitchell (frank.mitchell@sun.com)
* Denis Sharypov (sdv@sparc.spb.su)
* Igor Kushnirskiy (idk@eng.sun.com)
*/
/*
@ -255,7 +257,7 @@ interface_declaration(TreeState *state)
/* } */
/* fprintf(FILENAME(state), " =\n new nsID(\"%s\");\n\n", iid); */
fprintf(FILENAME(state), " public static final String IID =\n \"%s\";\n\n", iid);
fprintf(FILENAME(state), " public static final IID IID =\n new IID(\"%s\");\n\n", iid);
}
/*
@ -370,19 +372,22 @@ xpcom_to_java_type (TreeState *state)
IDL_NODE_TYPE(IDL_NODE_UP(state->tree)) == IDLN_NATIVE) {
const char *user_type = IDL_NATIVE(IDL_NODE_UP(state->tree)).user_type;
const char *ident_str = IDL_IDENT(IDL_NATIVE(IDL_NODE_UP(state->tree)).ident).str;
if (strcmp(user_type, "void") == 0) {
if (strcmp(user_type, "void") == 0) { /*it should not happend for scriptable methods*/
fputs("Object", FILENAME(state));
}
else if (strcmp(user_type, "nsID") == 0 ||
strcmp(user_type, "nsIID") == 0 ||
strcmp(user_type, "nsCID") == 0) {
/* XXX: s.b test for "iid" attribute */
/* XXX: special class for nsIDs */
/* XXX: s.b test for "id" attribute */
/* XXX: special class for nsIDs */
else if (strcmp(user_type, "nsID") == 0) {
fputs("ID", FILENAME(state));
} else if (strcmp(user_type, "nsIID") == 0) {
fputs("IID", FILENAME(state));
} else if (strcmp(user_type, "nsCID") == 0) {
fputs("CID", FILENAME(state));
}
else {
/* XXX: special class for opaque types */
fputs("OpaqueValue", FILENAME(state));
/*it should not happend for scriptable methods*/
fputs("OpaqueValue", FILENAME(state));
}
} else {
const char *ident_str = IDL_IDENT(state->tree).str;