private void configureCodeset() { String ncsc = configuration.getAttribute("jacorb.native_char_codeset", ""); String ncsw = configuration.getAttribute("jacorb.native_wchar_codeset", ""); if (ncsc != null && !("".equals(ncsc))) { CodeSet codeset = CodeSet.getCodeSet(ncsc); if (codeset != CodeSet.NULL_CODE_SET) { nativeCodeSetChar = codeset; logger.debug("Set default native char codeset to {} " + codeset); } else if (logger.isErrorEnabled()) { logger.error("Cannot set default NCSC to " + ncsc); } } // Fallback from above if we failed to set nativeCodeSetChar if (nativeCodeSetChar == null) { String sysenc = CodeSet.DEFAULT_PLATFORM_ENCODING; for (int i = 0; i < CodeSet.KNOWN_ENCODINGS.length; i++) { CodeSet codeset = CodeSet.KNOWN_ENCODINGS[i]; if (codeset.supportsCharacterData(/* wide */ false) && sysenc.equals(codeset.getName())) { nativeCodeSetChar = codeset; logger.debug("Set default native char codeset to {}", codeset); } } if (nativeCodeSetChar == null) { // didn't match any supported char encodings, default to iso 8859-1 if (logger.isWarnEnabled()) { logger.warn("Warning - unknown codeset (" + sysenc + ") - defaulting to ISO-8859-1"); } nativeCodeSetChar = CodeSet.ISO8859_1_CODESET; } } if (ncsw != null && !("".equals(ncsw))) { CodeSet codeset = CodeSet.getCodeSet(ncsw); if (codeset != CodeSet.NULL_CODE_SET) { nativeCodeSetWchar = codeset; logger.debug("Set default native wchar codeset to {}", codeset); } else if (logger.isErrorEnabled()) { logger.error("Cannot set default NCSW to " + ncsw); } } localCodeSetComponentInfo = new CodeSetComponentInfo(); localCodeSetComponentInfo.ForCharData = CodeSet.createCodeSetComponent(/* wide */ false, getTCSDefault()); localCodeSetComponentInfo.ForWcharData = CodeSet.createCodeSetComponent(/* wide */ true, getTCSWDefault()); }
protected void startService() throws Exception { Context ctx; ORB orb; POA rootPOA; try { ctx = new InitialContext(); } catch (NamingException e) { throw new RuntimeException("Cannot get intial JNDI context: " + e); } try { orb = (ORB) ctx.lookup("java:/" + CorbaORBService.ORB_NAME); } catch (NamingException e) { throw new RuntimeException("Cannot lookup java:/" + CorbaORBService.ORB_NAME + ": " + e); } try { rootPOA = (POA) ctx.lookup("java:/" + CorbaORBService.POA_NAME); } catch (NamingException e) { throw new RuntimeException("Cannot lookup java:/" + CorbaORBService.POA_NAME + ": " + e); } // Create the naming server POA as a child of the root POA Policy[] policies = new Policy[2]; policies[0] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID); policies[1] = rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT); namingPOA = rootPOA.create_POA("Naming", null, policies); namingPOA.the_POAManager().activate(); // initialize the static naming service variables. JBossNamingContextImpl.init(orb, rootPOA); // create and initialize the root context instance according to the configuration. JBossNamingContextImpl ns = new JBossNamingContextImpl(); Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration(); boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on"); boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on"); ns.init(namingPOA, doPurge, noPing); // create and activate the root context. byte[] rootContextId = "root".getBytes(); namingPOA.activate_object_with_id(rootContextId, ns); namingService = NamingContextExtHelper.narrow( namingPOA.create_reference_with_id( rootContextId, "IDL:omg.org/CosNaming/NamingContextExt:1.0")); // bind the root context to JNDI. bind(NAMING_NAME, "org.omg.CosNaming.NamingContextExt"); getLog().info("CORBA Naming Started"); getLog().debug("Naming: [" + orb.object_to_string(namingService) + "]"); }
/** Creates a new <code>DefaultAcceptorExceptionListener</code> instance. */ public void configure(Configuration configuration) { sslException = null; String exceptionClass = configuration.getAttribute("javax.net.ssl.SSLException", null); if (exceptionClass != null) { try { sslException = ObjectUtil.classForName(exceptionClass); } catch (ClassNotFoundException e) { // ignore } } logger = ((org.jacorb.config.Configuration) configuration).getLogger("org.jacorb.orb.iiop"); }
public AdminPropertySet(Configuration config) { super(); try { int _maxConsumersDefault = config.getAttributeAsInteger( Attributes.MAX_NUMBER_CONSUMERS, Default.DEFAULT_MAX_NUMBER_CONSUMERS); Any _maxConsumersDefaultAny = sORB.create_any(); _maxConsumersDefaultAny.insert_long(_maxConsumersDefault); ////////////////////////////// int _maxSuppliersDefault = config.getAttributeAsInteger( Attributes.MAX_NUMBER_SUPPLIERS, Default.DEFAULT_MAX_NUMBER_SUPPLIERS); Any _maxSuppliersDefaultAny = sORB.create_any(); _maxSuppliersDefaultAny.insert_long(_maxSuppliersDefault); ////////////////////////////// int _maxQueueLength = config.getAttributeAsInteger( Attributes.MAX_QUEUE_LENGTH, Default.DEFAULT_MAX_QUEUE_LENGTH); Any _maxQueueLengthAny = sORB.create_any(); _maxQueueLengthAny.insert_long(_maxQueueLength); ////////////////////////////// boolean _rejectNewEvents = config .getAttribute(Attributes.REJECT_NEW_EVENTS, Default.DEFAULT_REJECT_NEW_EVENTS) .equals("on"); Any _rejectNewEventsAny = sORB.create_any(); _rejectNewEventsAny.insert_boolean(_rejectNewEvents); ////////////////////////////// defaultProperties_ = new Property[] { new Property(MaxConsumers.value, _maxConsumersDefaultAny), new Property(MaxSuppliers.value, _maxSuppliersDefaultAny), new Property(MaxQueueLength.value, _maxQueueLengthAny), new Property(RejectNewEvents.value, _rejectNewEventsAny) }; set_admin(defaultProperties_); } catch (ConfigurationException ex) { throw new INTERNAL("Configuration exception" + ex); } }