प्रतिक्रियाओं लोगों के लिए धन्यवाद,
यह ग्रहण में IProxyService वर्ग का उपयोग किया जा सकता है। नीचे दिए गए कोड स्निपेट्स ने कुछ मामलों में प्रतिबिंब का उपयोग किया है जिन्हें आप अनदेखा कर सकते हैं। इसके अलावा इस लिंक (http://www.vogella.de/blog/2009/12/08/eclipse-rcp-proxy-preference/)
1 पर एक नज़र डालें) प्रॉक्सी पर नजर
private ServiceTracker getProxyTracker() throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
if (proxyTracker != null)
return proxyTracker;
String proxyServiceClassName = "org.eclipse.core.net.proxy.IProxyService";
String bundleClassName = "org.osgi.framework.Bundle";
Class bundleClass = Class.forName(bundleClassName);
Method getBundleContextMth = bundleClass.getMethod("getBundleContext", null);
getBundleContextMth.setAccessible(true);
BundleContext bundleCntx = (BundleContext) getBundleContextMth.invoke(bundle, null);
proxyTracker = new ServiceTracker(bundleCntx, proxyServiceClassName, null);
proxyTracker.open();
return proxyTracker;
}
2) की जांच करने के लिए "isProxiesEnabled" विधि का प्रयोग करें यदि प्रॉक्सी
3 सक्षम किया गया है) के आधार पर प्राप्त करें ग्रहण संस्करण ग्रहण प्रॉक्सी जानकारी (होस्ट, उपयोगकर्ता आईडी, पासवर्ड इत्यादि) तक पहुंचने के लिए "getProxyDataForHost" या "select" विधि का उपयोग करें।
स्रोत
2011-05-20 18:37:52
लक्ष्य होस्ट पर आधारित जावास्क्रिप्ट फ़ंक्शन द्वारा गतिशील = गणना नहीं है? क्या आपने IProxyService.select (URI) विधि का उपयोग करने का प्रयास किया है और वहां अपना लक्ष्य यूआरएल निर्दिष्ट किया है? –