*not part of tbox builds*

fix for 63586


git-svn-id: svn://10.0.0.236/trunk@83988 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
idk%eng.sun.com
2000-12-22 07:28:26 +00:00
parent 483b7c6c82
commit fcb39909f5
10 changed files with 297 additions and 2 deletions

View File

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

View File

@@ -0,0 +1,33 @@
/* -*- 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 Components {
public static nsIComponentManager getComponentManager() {
return componentMgr;
}
public static void setComponentManager(nsIComponentManager mgr) {
componentMgr = mgr;
}
private static nsIComponentManager componentMgr = null;
};

View File

@@ -0,0 +1,55 @@
#!gmake
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Igor Kushnirskiy <idk@eng.sun.com>
#
DEPTH = ../../../..
topsrcdir = ../../../..
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
MODULE = blackConnectInit
LIBRARY_NAME = blackConnectInit
IS_COMPONENT = 1
XPIDL_MODULE = blackConnectInit
XPIDLSRCS = bcIBlackConnectInit.idl
CPPSRCS = bcBlackConnectInit.cpp
include $(topsrcdir)/config/rules.mk
COMPONENT=bcBlackConnectInit
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 $<
install-component: $(COMPONENT).jar.comp $(COMPONENT).jar.info
cp $(COMPONENT).jar.comp $(COMPONENT).jar.info $(DEPTH)/dist/bin/components/
clobber-java:
rm -f *.class *.jar
clobber:: clobber-java
clobber_all:: clobber-java
install:: install-component

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; 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>
*/
#include "bcIBlackConnectInit.h"
#include "nsIModule.h"
static int counter = 0; //we do not need to call it on unload time;
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *compMgr,
nsIFile *location,
nsIModule** result) //I am using it for initialization only
{
nsresult r;
if (counter == 0) {
counter ++;
bcIBlackConnectInit *blackConnectInit;
r = nsComponentManager::CreateInstance("bcBlackConnectInit",
nsnull,
NS_GET_IID(bcIBlackConnectInit),
(void**)&blackConnectInit);
if (NS_SUCCEEDED(r)) {
nsIComponentManager* cm;
r = NS_GetGlobalComponentManager(&cm);
if (NS_SUCCEEDED(r)) {
blackConnectInit->InitComponentManager(cm);
}
}
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,48 @@
/* -*- 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>
*/
import org.mozilla.xpcom.*;
public class bcBlackConnectInit implements bcIBlackConnectInit {
public bcBlackConnectInit() {
}
public Object queryInterface(IID iid) {
Object result;
if ( nsISupportsIID.equals(iid)
|| bcIBlackConnectInitIID.equals(iid)) {
result = this;
} else {
result = null;
}
return result;
}
/* void initComponentManager (in nsIComponentManager cm); */
public void initComponentManager(nsIComponentManager cm) {
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);
}
}

View File

@@ -0,0 +1,9 @@
#include "nsISupports.idl"
#include "nsIComponentManager.idl"
[scriptable, uuid(d4867a7e-1dd1-11b2-a009-b111ab5d7639)]
interface bcIBlackConnectInit : nsISupports
{
void initComponentManager(in nsIComponentManager cm);
};

View File

@@ -0,0 +1,30 @@
/*
* ************* 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
*/

View File

@@ -0,0 +1,66 @@
#!gmake
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1999 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Igor Kushnirskiy <idk@eng.sun.com>
#
DEPTH = ..\..\..\..
topsrcdir = ..\..\..\..
srcdir = .
VPATH = .
MAKE_OBJ_TYPE=DLL
MODULE=javaSample
COMPONENT=1
DLLNAME=$(MODULE)
DLL=.\$(OBJDIR)\$(DLLNAME).dll
XPIDLSRCS = \
.\bcIBlackConnectInit.idl \
$(NULL)
OBJS = .\$(OBJDIR)\bcBlackConnectInit.obj
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
COMPONENT=bcBlackConnectInit
CLASSES=bcIBlackConnectInit.class bcJavaSample.class
$(COMPONENT).jar.comp: manifest $(CLASSES)
$(JDKHOME)\bin\jar cvfm $(COMPONENT).jar.comp manifest *.class
.SUFFIXES: .java .class
.java.class:
$(JDKHOME)\bin\javac -classpath .;..\classes $<
install-component: $(COMPONENT).jar.comp $(COMPONENT).jar.info $(DLL)
copy $(COMPONENT).jar* $(DIST)\bin\components
copy $(DLL) $(DIST)\bin\components
clobber-java:
-del *.class *.jar.comp
clobber:: clobber-java
rm $(DIST)\bin\components\$(DLLNAME).dll
rm $(DIST)\bin\components\$(COMPONENT).jar.*
clobber_all:: clobber-java
install:: install-component

View File

@@ -0,0 +1 @@
Component-Class: bcBlackConnectInit

View File

@@ -24,10 +24,12 @@
DEPTH = ..\..\..
DIRS= \
xpidl \
loader \
src \
classes \
test \
# test \
components \
$(NULL)
include <$(DEPTH)\config\rules.mak>