List of usage examples for java.lang Boolean Boolean
@Deprecated(since = "9") public Boolean(String s)
From source file:gate.DocumentFormat.java
/** If the document format could collect repositioning information * during the unpack phase this method will return <B>true</B>. * <BR>/* w w w .ja v a 2 s.com*/ * You should override this method in the child class of the defined * document format if it could collect the repositioning information. */ public Boolean supportsRepositioning() { return new Boolean(false); }
From source file:nc.noumea.mairie.organigramme.core.ws.SirhWSConsumer.java
@Override public List<FichePosteTreeNodeDto> getTreeFichesPosteByEntite(Integer idEntite, boolean withFichesPosteNonReglemente) { String url = String.format(sirhWsBaseUrl + URL_TREE_FICHE_POSTE_PAR_ENTITE); HashMap<String, String> params = new HashMap<>(); params.put("idEntite", idEntite.toString()); params.put("withFichesPosteNonReglemente", new Boolean(withFichesPosteNonReglemente).toString()); LOGGER.debug("getTreeFichesPosteByEntite with url " + url); ClientResponse res = createAndFireGetRequest(params, url); return readResponseAsList(FichePosteTreeNodeDto.class, res, url); }
From source file:org.fcrepo.client.impl.FedoraDatastreamImplTest.java
@Before public void setUp() throws IOException, FedoraException { initMocks(this); mockRepository.httpHelper = mockHelper; when(mockRepository.getRepositoryUrl()).thenReturn(repositoryURL); when(mockRepository.getObject(eq("/test"))).thenReturn(mockObject); datastream = new FedoraDatastreamImpl(mockRepository, mockHelper, path); assertTrue(datastream != null);//from w w w . j a va2s . c o m final Graph graph = createDefaultGraph(); graph.add( create(dsSubj, CREATED_DATE.asNode(), ResourceFactory.createPlainLiteral(testDateValue).asNode())); graph.add(create(dsSubj, LAST_MODIFIED_DATE.asNode(), ResourceFactory.createPlainLiteral(testDateValue).asNode())); graph.add(create(dsSubj, HAS_MIXIN_TYPE.asNode(), createURI(testMixinType))); graph.add(create(dsSubj, WRITABLE.asNode(), ResourceFactory.createTypedLiteral(new Boolean(isWritable)).asNode())); graph.add(create(dsSubj, DESCRIBES.asNode(), contentSubj)); graph.add(create(contentSubj, HAS_SIZE.asNode(), ResourceFactory.createPlainLiteral(contentSize).asNode())); graph.add( create(contentSubj, HAS_MIME_TYPE.asNode(), ResourceFactory.createPlainLiteral(mimeType).asNode())); graph.add(create(contentSubj, HAS_ORIGINAL_NAME.asNode(), ResourceFactory.createPlainLiteral(filename).asNode())); graph.add(create(contentSubj, REST_API_DIGEST.asNode(), createURI(checksum))); datastream.setGraph(graph); }
From source file:com.zimbra.qa.unittest.TestImap.java
private void checkRegex(String regexPatt, String target, Boolean expected, int maxAccesses, Boolean timeoutOk) { try {/*from w w w .j a v a 2 s .c o m*/ Pattern patt = Pattern.compile(regexPatt); AccessBoundedRegex re = new AccessBoundedRegex(patt, maxAccesses); assertEquals(String.format("matching '%s' against pattern '%s'", target, patt), expected, new Boolean(re.matches(target))); } catch (AccessBoundedRegex.TooManyAccessesToMatchTargetException se) { assertTrue("Throwing exception considered OK", timeoutOk); } }
From source file:bboss.org.artofsolving.jodconverter.OfficeDocumentConverter.java
public File getRealWordFromWordTemplateWithArraydatas(String wordtemplate, String wordfile, String[] bookmarks, Object[] bookdatas) throws Exception { Map<String, Object> defaultLoadProperties = new HashMap<String, Object>(); defaultLoadProperties.put("AsTemplate", new Boolean(true)); defaultLoadProperties.put("Hidden", new Boolean(true)); String outputExtension = FilenameUtils.getExtension(wordfile); DocumentFormat outputFormat = formatRegistry.getFormatByExtension(outputExtension); String inputExtension = FilenameUtils.getExtension(outputExtension); DocumentFormat inputFormat = formatRegistry.getFormatByExtension(inputExtension); WorkBookmarkConvertorTask conversionTask = new WorkBookmarkConvertorTask(wordtemplate, wordfile, bookmarks, bookdatas, outputFormat);/* ww w . j a v a 2 s.c om*/ conversionTask.setDefaultLoadProperties(defaultLoadProperties); // Map<String,Object> defaultStoreProperties = null; // conversionTask.setDefaultStroreProperties(defaultStoreProperties); conversionTask.setInputFormat(inputFormat); officeManager.execute(conversionTask); return conversionTask.getOutputFile(); }
From source file:com.searchbox.framework.bootstrap.BootStrap.java
public void doBootStrap() { if (BOOTSTRAPED) { return;/*from w w w.ja va 2s . c om*/ } BOOTSTRAPED = true; boolean doBootstrap = new Boolean(env.getProperty("searchbox.bootstrap", "false")); if (doBootstrap) { /** * The embedded Solr SearchEngine */ LOGGER.info("++ Creating Search Engine"); SearchEngineEntity<?> engine = null; try { String className = env.getProperty("searchengine.class", EmbeddedSolr.class.getName()); Class<SearchEngine<?, ?>> clazz = (Class<SearchEngine<?, ?>>) Class.forName(className); engine = new SearchEngineEntity<>().setClazz(clazz).setAttribute( env.getProperty("searchengine.prop", "solrHome"), env.getProperty("searchengine.prop.value", context.getResource("classpath:solr/").getURL().getPath())); engine = engineRepository.save(engine); } catch (Exception e) { LOGGER.error("Could not set definition for SolrEmbededServer", e); } LOGGER.info("Creating Default Users..."); UserEntity system = userService.registerNewUserAccount("system@searchbox.com", "password"); UserEntity admin = userService.registerNewUserAccount("admin@searchbox.com", "password"); UserEntity user = userService.registerNewUserAccount("user@searchbox.com", "password"); system = userService.addRole(system, Role.SYSTEM, Role.ADMIN, Role.USER); admin = userService.addRole(admin, Role.ADMIN, Role.USER); user = userService.addRole(user, Role.USER); userRepository.save(new UserEntity().setEmail("jonathan@xtremsoft.com").setFirstName("Jonathan") .setRoles(Arrays.asList(new Role[] { Role.ADMIN, Role.SYSTEM, Role.USER }))); userRepository.save(new UserEntity().setEmail("jonatrey@yahoo.com") .setPassword(userService.encodePasswordString("searchbox2014")).setFirstName("Jonathan Rey") .setRoles(Arrays.asList(new Role[] { Role.USER }))); userRepository.save(new UserEntity().setEmail("jonatrey@test.com") .setPassword(userService.encodePasswordString("searchbox2014")).setFirstName("Jonathan Rey")); userRepository.save(new UserEntity().setEmail("stephane@gamard.net").setFirstName("stephane") .setRoles(Arrays.asList(new Role[] { Role.ADMIN, Role.SYSTEM, Role.USER }))); LOGGER.info("Bootstraping application with oppfin data..."); /** * The base Searchbox. */ LOGGER.info("++ Creating oppfin searchbox"); SearchboxEntity searchbox = new SearchboxEntity().setSlug("oppfin") .setName("Opportunity Finder Searchbox").setLogo("/assets/images/oppfin-logo.png"); List<String> lang = new ArrayList<String>(); lang.add("en"); /** * * Oppfin Collections * */ LOGGER.info("++ Creating oppfin Topic Collection"); CollectionEntity<?> topicsCollection = new CollectionEntity<>().setClazz(TopicCollection.class) .setName("H2020Topics").setAutoStart(false).setIdFieldName("topicIdentifier") .setSearchEngine(engine); topicsCollection = collectionRepository.save(topicsCollection); LOGGER.info("++ Creating oppfin EEN Collection"); CollectionEntity<?> eenCollection = new CollectionEntity<>().setClazz(EENCollection.class) .setName("eenCooperations").setAutoStart(false).setIdFieldName("eenReferenceExternal") .setSearchEngine(engine); eenCollection = collectionRepository.save(eenCollection); /** The base collection for idealist */ LOGGER.info("++ Creating oppfin IDEALIST Collection"); CollectionEntity<?> idealistCollection = new CollectionEntity<>().setClazz(IdealISTCollection.class) .setName("idealistCooperations").setSearchEngine(engine).setAutoStart(false) .setIdFieldName("uid"); idealistCollection = collectionRepository.save(idealistCollection); LOGGER.info("++ Creating oppfin CORDIS Collection"); CollectionEntity<?> cordisCollection = new CollectionEntity<>().setClazz(CordisCollection.class) .setIdFieldName("cordisId").setName("fundedProjects").setAutoStart(false) .setSearchEngine(engine); cordisCollection = collectionRepository.save(cordisCollection); searchbox.newPreset().setLabel("Search All").setDescription("All Collections").setSlug("all") .setCollection( collectionRepository.save(new CollectionEntity<>().setClazz(MultiCollection.class) .setName("all").setSearchEngine(engine).setAttribute("collections", Arrays.asList(new String[] { topicsCollection.getName(), eenCollection.getName(), idealistCollection.getName(), cordisCollection.getName() })))) .addQueryElement().addFieldFacet("Source", "docSource").addStatElement() .addPagingElement("search").addDebugElement() /** * * Topic Preset * */ //Create a new preset in searchbox .newChildPreset(true, TemplateElement.class).setLabel("Project Funding") .setDescription("Project Funding (open calls)").setSlug("funding") .addRangeCondition("Future deadlines only", "callDeadline", "NOW", "*") .setCollection(topicsCollection) /** * Setting up fieldAttributes for preset */ .newFieldAttribute("topicIdentifier").setAttribute("searchable", true) .setAttribute("spelling", true).setAttribute("suggestion", true) .setAttribute("label", "Topic ID").end() .newFieldAttribute("callIdentifier").setAttribute("searchable", true) .setAttribute("spelling", true).setAttribute("suggestion", true) .setAttribute("label", "Call ID").end() .newFieldAttribute("topicTitle").setAttribute("searchable", true).setAttribute("spelling", true) .setAttribute("suggestion", true).setAttribute("highlight", true).setAttribute("label", "title") .setAttribute("lang", lang).end() .newFieldAttribute("description", "topicDescriptionRaw").setAttribute("searchable", true) .setAttribute("spelling", true).setAttribute("suggestion", true).setAttribute("highlight", true) .setAttribute("label", "description").setAttribute("lang", lang).end() .newFieldAttribute("callDeadline").setAttribute("sortable", true).end() /** * Creating the SearchElements for preset */ .newSearchElement().setClazz(SolrToString.class).end() .newSearchElement("search").setClazz(EdismaxQuery.class).end().newSearchElement("view") .setClazz(EdismaxQuery.class).end() .newSearchElement().setClazz(TemplateElement.class).setAttribute("titleField", "topicTitle") .setAttribute("idField", topicsCollection.getIdFieldName()) .setAttribute("templateFile", "/WEB-INF/templates/oppfin/_topicHit.jspx").setProcess("search") .end() .newSearchElement().setClazz(MoreLikeThisQuery.class).setProcess("mlt").end().newSearchElement() .setClazz(TemplateElement.class).setAttribute("titleField", "topicTitle") .setAttribute("idField", topicsCollection.getIdFieldName()) .setAttribute("templateFile", "/WEB-INF/templates/oppfin/_topicMLTHit.jspx").setProcess("mlt") .end() .newSearchElement().setClazz(TemplateElement.class).setLabel("leftCol").setProcess("view") .setAttribute("titleField", "topicTitle") .setAttribute("idField", topicsCollection.getIdFieldName()) .setAttribute("templateFile", "/WEB-INF/templates/oppfin/_topicViewMeta.jspx").end() .newSearchElement().setClazz(TemplateElement.class).setLabel("body").setProcess("view") .setAttribute("titleField", "topicTitle") .setAttribute("idField", topicsCollection.getIdFieldName()) .setAttribute("templateFile", "/WEB-INF/templates/oppfin/_topicView.jspx").end() .newSearchElement().setClazz(FieldSort.class) .setAttribute("values", new TreeSet<FieldSort.Value>(Arrays.asList(new FieldSort.Value[] { FieldSort.getRelevancySort(), new FieldSort.Value( "By Deadline <span class=\"pull-right glyphicon glyphicon-chevron-up\"></span>", "callDeadline", Sort.ASC), new FieldSort.Value( "By Deadline <span class=\"pull-right glyphicon glyphicon-chevron-down\"></span>", "callDeadline", Sort.DESC) }))) .end() .newSearchElement().setClazz(BasicSearchStats.class).setLabel("Basic Stats") .setProcess("search").end() .newSearchElement().setClazz(FieldFacet.class).setLabel("Call") .setAttribute("fieldName", "callIdentifier").setAttribute("order", Order.BY_VALUE) .setAttribute("sort", Sort.DESC).end() /** * Ideally this is a range facet. We agreed that for now it will be a list * of months For instance(March 14, April 14, May 14, June 14, ...) */ .newSearchElement().setClazz(FieldFacet.class).setLabel("Deadline") .setAttribute("fieldName", "callDeadline").setAttribute("order", Order.BY_VALUE) .setAttribute("sort", Sort.DESC).end() .newSearchElement().setClazz(FieldFacet.class).setAttribute("fieldName", "topicFlags") .setLabel("Flags").setAttribute("order", Order.BY_VALUE).setAttribute("sort", Sort.DESC).end() .newSearchElement().setClazz(BasicPagination.class).setProcess("search").end().endChild() /** * * Cooperation preset * * */ .newChildPreset(true, TemplateElement.class) .setCollection(collectionRepository.save(new CollectionEntity<>() .setClazz(MultiCollection.class).setName("cooperations").setSearchEngine(engine) .setAttribute("collections", Arrays.asList( new String[] { eenCollection.getName(), idealistCollection.getName() })))) .setSlug("cooperations").addRangeCondition("Future deadlines only", "deadline", "NOW", "*") .setLabel("Cooperations").addQueryElement("search").addQueryElement("view").addStatElement() .addFieldFacet("Cooperation Source", "docSource").addFieldFacet("EEN Type", "eenReferenceType") .addFieldFacet("Keyword", "eenKeywordTechnologiesLabel") .addFieldFacet("Partner Country", "eenCompanyCountryLabel") //TODO Steph: Check why this is failing. .newSearchElement().setClazz(FieldSort.class) .setAttribute("values", new TreeSet<FieldSort.Value>(Arrays.asList(new FieldSort.Value[] { FieldSort.getRelevancySort(), new FieldSort.Value( "By Update <span class=\"pull-right glyphicon glyphicon-chevron-down\"></span>", StandardCollection.STD_UPDATED_FIELD, Sort.DESC), new FieldSort.Value( "By Deadline <span class=\"pull-right glyphicon glyphicon-chevron-up\"></span>", ExpiringDocuments.STD_DEADLINE_FIELD, Sort.ASC) }))) .end() /*.addSortableFieldAttribute("Published", "eenDatumSubmit") .addSortableFieldAttribute("Updated", "eenDatumUpdate") .addSortableFieldAttribute("Deadline", "eenDatumDeadline")*/ .addPagingElement("search").addDebugElement() /** * * EEN preset * * */ //LOGGER.info("++ Creating Cooperation preset"); //searchbox.newPreset() .newChildPreset(true, FieldFacet.class, TemplateElement.class, MoreLikeThisQuery.class) .setCollection(eenCollection).setDescription("EEN cooperations").setLabel("EEN").setSlug("een") .setVisible(false) .addSortableFieldAttribute("Published", "eenDatumSubmit") .addSortableFieldAttribute("Updated", "eenDatumUpdate") .addSortableFieldAttribute("Deadline", "eenDatumDeadline") .newFieldAttribute("Title", "eenContentTitle").setSearchanble(true).setHighlight(true) .setSpelling(true).setSuggestion(true).setLanguages(lang).end() .newFieldAttribute("Summary", "eenContentSummary").setSearchanble(true).setHighlight(true) .setSpelling(true).setSuggestion(true).setLanguages(lang).end() .newFieldAttribute("Keyword", "eenKeywordTechnologiesLabel").setSearchanble(true) .setSpelling(true).setHighlight(true).setLanguages(lang).end() .newFieldAttribute("Description", "eenContentDescription").setSearchanble(true) .setHighlight(true).setSpelling(true).setSuggestion(true).setLanguages(lang).end() .addQueryElement("Search").addQueryElement("view") .newSearchElement().setClazz(BasicSearchStats.class).setProcess("search").end() .newTemplateElement("eenContentTitle", "/WEB-INF/templates/oppfin/_eenHit.jspx") .setProcess("search").end() .newSearchElement("mlt").setClazz(MoreLikeThisQuery.class).end() .newTemplateElement("eenContentTitle", "/WEB-INF/templates/oppfin/_eenMLTHit.jspx") .setProcess("mlt").end() .newTemplateElement("eenContentTitle", "/WEB-INF/templates/oppfin/_eenViewMeta.jspx") .setLabel("leftCol").setProcess("view").end() .newTemplateElement("eenContentTitle", "/WEB-INF/templates/oppfin/_eenView.jspx") .setLabel("body").setProcess("view").end() .newSearchElement().setClazz(FieldSort.class) .setAttribute("values", new TreeSet<FieldSort.Value>( Arrays.asList(new FieldSort.Value[] { FieldSort.getRelevancySort(), new FieldSort.Value("Newest first", "eenDatumUpdate", Sort.DESC) }))) .end() .addFieldFacet("EEN Type", "eenReferenceType") .addFieldFacet("Keyword", "eenKeywordTechnologiesLabel") .addFieldFacet("Partner Country", "eenCompanyCountryLabel") .addPagingElement("search").addDebugElement().endChild() /** * IDEALIST PRESET * * */ .newChildPreset(true, FieldFacet.class, TemplateElement.class).setCollection(idealistCollection) .setSlug("idealist").setLabel("Ideal-IST").setVisible(false) .setDescription("IDEALIST cooperations") //.addFieldCondition("Open Opportunities Only", "idealistStatus","Open") .addFieldFacet("Status", "idealistStatus") .newFieldAttribute("Title", "idealistTitle").setLanguages(lang).setSearchanble(true) .setHighlight(true).setSpelling(true).setSuggestion(true).end() .newFieldAttribute("Summary", "idealistOutline").setLanguages(lang).setSearchanble(true) .setHighlight(true).setSpelling(true).setSuggestion(true).end() .newFieldAttribute("Summary", "idealistBody").setLanguages(lang).setSearchanble(true) .setHighlight(true).setSpelling(true).setSuggestion(true).end() // /** Facets for the presetIdealist. */ // /** // * - Cooperation Source // * - Partner Country // */ .addQueryElement().addStatElement() .newTemplateElement("idealistTitle", "/WEB-INF/templates/oppfin/_idealistHit.jspx") .setProcess("search").end() .newTemplateElement("idealistTitle", "/WEB-INF/templates/oppfin/_idealistMLTHit.jspx") .setProcess("mlt").end() .newTemplateElement("idealistTitle", "/WEB-INF/templates/oppfin/_idealistView.jspx") .setLabel("body").setProcess("view").end() .newTemplateElement("idealistTitle", "/WEB-INF/templates/oppfin/_idealistViewMeta.jspx") .setLabel("leftCol").setProcess("view").end() .addPagingElement("search").addDebugElement().endChild().endChild() /** * * Cordis Preset * * */ //LOGGER.info("++ Creating CORDIS preset"); .newChildPreset(true, TemplateElement.class).setLabel("Funded Projects") .setDescription("Funded projects").setSlug("funded").setCollection(cordisCollection) .newFieldAttribute("Title", "cordisTitle").setLanguages(lang).setSearchanble(true) .setHighlight(true).setSpelling(true).setSuggestion(true).end() .newFieldAttribute("Summary", "cordisSnippet").setLanguages(lang).setSearchanble(true) .setHighlight(true).setSpelling(true).setSuggestion(true).end() .addQueryElement().addStatElement() .addFieldFacet("Year", "cordisStartYear").addFieldFacet("Area", "cordisArea") .addFieldFacet("Category", "cordisCategory").addFieldFacet("Tag", "cordisTag") .addFieldFacet("Status", "cordisProjectStatus") .newTemplateElement("cordisTitle", "/WEB-INF/templates/oppfin/_cordisHit.jspx") .setProcess("search").end() .newTemplateElement("cordisTitle", "/WEB-INF/templates/oppfin/_cordisView.jspx") .setLabel("body").setProcess("view").end() .newTemplateElement("cordisTitle", "/WEB-INF/templates/oppfin/_cordisViewMeta.jspx") .setLabel("leftCol").setProcess("view").end() .addPagingElement("search").addDebugElement().endChild().end(); /** * Users preset */ // searchbox.addUserRole(new UserRole(system, Role.SYSTEM)) // .addUserRole(new UserRole(admin, Role.ADMIN)) // .addUserRole(new UserRole(user, Role.USER)); repository.save(searchbox); LOGGER.info("Bootstraping application with oppfin data... done"); } LOGGER.info("Starting all your engine"); Iterator<SearchEngineEntity<?>> searchEngines = engineRepository.findAll().iterator(); while (searchEngines.hasNext()) { SearchEngineEntity<?> searchEngine = searchEngines.next(); LOGGER.info("++ Starting SearchEngine: " + searchEngine.getName()); searchEngine.build(); } LOGGER.info("****************************************************"); LOGGER.info("* Welcome *"); LOGGER.info("****************************************************"); LOGGER.info("* *"); LOGGER.info("* __ _ *"); LOGGER.info("* ___ _ __ _ __ / _(_)_ __ *"); LOGGER.info("* / _ \\| '_ \\| '_ \\| |_| | '_ \\ *"); LOGGER.info("* | (_) | |_) | |_) | _| | | | | *"); LOGGER.info("* \\___/| .__/| .__/|_| |_|_| |_| *"); LOGGER.info("* |_| |_| *"); LOGGER.info("* *"); LOGGER.info("****************************************************"); LOGGER.info("* *"); LOGGER.info("****************************************************"); LOGGER.info("* *"); LOGGER.info("* Your searchbox is running in DEMO mode and *"); LOGGER.info("* sample data from the PUBMED directory has been *"); LOGGER.info("* automatically added. *"); LOGGER.info("* *"); LOGGER.info("* visit: http://localhost:8080/searchbox *"); LOGGER.info("* admin: http://localhost:8080/searchbox/admin *"); LOGGER.info("* *"); LOGGER.info("****************************************************"); publisher.publishEvent(new SearchboxReady(this)); }
From source file:modelibra.designer.metaproperty.GenMetaProperty.java
/** * Sets value. * * @param value * value */ public void setValue(boolean value) { setValue(new Boolean(value)); }
From source file:com.jdom.junit.utils.AbstractFixture.java
/** * Get a randomized value./*from www . ja va 2 s . co m*/ * * @param value * the value to randomize * @param salt * the randomizer to use * @return the randomized value */ public static Boolean getSaltedValue(Boolean value, int salt) { boolean retValuePrimative = value.booleanValue(); if (salt % 2 != 0) { retValuePrimative = !retValuePrimative; } return new Boolean(retValuePrimative); }
From source file:org.sakaiproject.metaobj.shared.control.AbstractStructuredArtifactDefinitionController.java
protected ModelAndView prepareListView(Map request, String recentId) { Map model = new HashMap(); String worksiteId = getWorksiteManager().getCurrentWorksiteId().getValue(); model.put("isMaintainer", isMaintainer()); model.put("worksite", getWorksiteManager().getSite(worksiteId)); model.put("sites", getUserSites()); ToolConfiguration tool = getWorksiteManager().getTool(ToolManager.getCurrentPlacement().getId()); model.put("tool", tool); model.put("currentAgent", getAuthManager().getAgent()); boolean global = getStructuredArtifactDefinitionManager().isGlobal(); model.put("isGlobal", new Boolean(global)); if (global) { model.put("authZqualifier", getIdManager().getId(StructuredArtifactDefinitionManager.GLOBAL_SAD_QUALIFIER)); } else {//ww w .ja v a 2 s .c om if (tool != null) { model.put("authZqualifier", getIdManager().getId(tool.getId())); } else { model.put("authZqualifier", getIdManager().getId(ToolManager.getCurrentPlacement().getId())); } } List types; if (getStructuredArtifactDefinitionManager().isGlobal()) { types = getStructuredArtifactDefinitionManager().findGlobalHomes(); } else { types = getStructuredArtifactDefinitionManager().findAvailableHomes( getWorksiteManager().getCurrentWorksiteId(), getAuthManager().getAgent().getId().getValue(), true, false); } Collections.sort(types); List typesList = new ArrayList(types); if (recentId != null) { request.put(ListScroll.ENSURE_VISIBLE_TAG, "" + getTypeIndex(typesList, recentId)); model.put("newFormId", recentId); } types = getListScrollIndexer().indexList(request, model, typesList); model.put("types", types); Boolean showUsage = false; if (tool != null) { showUsage = Boolean.parseBoolean((String) tool.getConfig().getProperty("display.usage")); } model.put("toolShowUsage", showUsage); return new ModelAndView("success", model); }
From source file:net.sbbi.upnp.jmx.JMXManager.java
private MBeanServer initMBeanServer(MBeanServerConfig conf) throws Exception { mx4j.log.Log.redirectTo(new CommonsLogger()); // make sure that MX4j Server builder is used String oldSysProp = System.getProperty("javax.management.builder.initial"); System.setProperty("javax.management.builder.initial", "mx4j.server.MX4JMBeanServerBuilder"); MBeanServer server = MBeanServerFactory.createMBeanServer("UPNPLib"); if (oldSysProp != null) { System.setProperty("javax.management.builder.initial", oldSysProp); }// w w w . ja va 2s . c om ObjectName serverName = new ObjectName("Http:name=HttpAdaptor"); server.createMBean("mx4j.tools.adaptor.http.HttpAdaptor", serverName, null); // set attributes server.setAttribute(serverName, new Attribute("Port", new Integer(conf.adapterAdapterPort))); Boolean allowWanBool = new Boolean(conf.allowWan); if (allowWanBool.booleanValue()) { server.setAttribute(serverName, new Attribute("Host", "0.0.0.0")); } else { server.setAttribute(serverName, new Attribute("Host", "localhost")); } ObjectName processorName = new ObjectName("Http:name=XSLTProcessor"); server.createMBean("mx4j.tools.adaptor.http.XSLTProcessor", processorName, null); server.setAttribute(processorName, new Attribute("LocaleString", conf.locale)); server.setAttribute(processorName, new Attribute("UseCache", Boolean.FALSE)); server.setAttribute(processorName, new Attribute("PathInJar", "net/sbbi/jmx/xsl")); server.setAttribute(serverName, new Attribute("ProcessorName", processorName)); // add user names server.invoke(serverName, "addAuthorization", new Object[] { conf.adapterUserName, conf.adapterPassword }, new String[] { "java.lang.String", "java.lang.String" }); // use basic authentication server.setAttribute(serverName, new Attribute("AuthenticationMethod", "basic")); // starts the server server.invoke(serverName, "start", null, null); return server; }