当前位置: 首页>>代码示例>>Java>>正文


Java Name.recycle方法代码示例

本文整理汇总了Java中lotus.domino.Name.recycle方法的典型用法代码示例。如果您正苦于以下问题:Java Name.recycle方法的具体用法?Java Name.recycle怎么用?Java Name.recycle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lotus.domino.Name的用法示例。


在下文中一共展示了Name.recycle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _getPerson

import lotus.domino.Name; //导入方法依赖的package包/类
public String _getPerson(Definition def, String strValue, Session sesCurrent) {
	String rcValue = strValue;
	if (def.isReader() || def.isAuthor() || def.isNames() && !StringUtil.isEmpty(def.getShowNameAs())) {
		try {
			Name nonCurrent = sesCurrent.createName(strValue);

			if ("ABBREVIATE".equalsIgnoreCase(def.getShowNameAs())) {
				rcValue = nonCurrent.getAbbreviated();
			} else if ("CN".equals(def.getShowNameAs())) {
				rcValue = nonCurrent.getCommon();
			}
			nonCurrent.recycle();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return rcValue;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:19,代码来源:NamesProcessor.java

示例2: getOnlineUsers

import lotus.domino.Name; //导入方法依赖的package包/类
@Override
public List<SelectItem> getOnlineUsers() throws NotesException{
	List<SelectItem> list = new ArrayList<SelectItem>();
	for(String user : this.getUsers()){
		Name name = XSPUtils.session().createName(user);
		SelectItem select = new SelectItem(user,name.getAbbreviated());
		list.add(select);
		name.recycle();
	}
	return list;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:12,代码来源:AbstractWebSocketBean.java

示例3: getUsersByUri

import lotus.domino.Name; //导入方法依赖的package包/类
@Override
public List<SelectItem> getUsersByUri(String uri) throws NotesException{
	UriUserMap map = server.getUriUserMap();
	List<SelectItem> list = new ArrayList<SelectItem>();
	for(IUser user : map.get(uri)){
		ContextWrapper wrapper = user.findConnection(uri);
		if(wrapper!=null && wrapper.isOpen()){
			Name name = XSPUtils.session().createName(user.getUserId());
			SelectItem select = new SelectItem(user.getUserId(),name.getCommon());
			list.add(select);
			name.recycle();
		}
	}
	return list;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:16,代码来源:AbstractWebSocketBean.java

示例4: makeCanonical

import lotus.domino.Name; //导入方法依赖的package包/类
private String makeCanonical(String strUserName) {
	String strRC = strUserName;
	try {
		if (strRC != null && !"".equals(strRC)) {
			Name nonCurrent = ExtLibUtil.getCurrentSession().createName(strUserName);
			strRC = nonCurrent.getCanonical();
			nonCurrent.recycle();
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
	return strRC;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:14,代码来源:MyWebGatePeopleDataProvider.java

示例5: setPerson

import lotus.domino.Name; //导入方法依赖的package包/类
public String setPerson(String strValue, boolean isNamesValue, Session sesCurrent) {
	String rcValue = strValue;
	try {
		if (isNamesValue) {
			Name person = sesCurrent.createName(strValue);
			if (person != null) {
				rcValue = person.getCanonical();
				person.recycle();
			}
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
	return rcValue;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:16,代码来源:NamesProcessor.java

示例6: getOnlineUsers

import lotus.domino.Name; //导入方法依赖的package包/类
public List<SelectItem> getOnlineUsers() throws NotesException{
	List<SelectItem> list = new ArrayList<SelectItem>();
	for(String user : this.getUsers()){
		Name name = XSPUtils.session().createName(user);
		SelectItem select = new SelectItem(user,name.getAbbreviated());
		list.add(select);
		name.recycle();
	}
	return list;
}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:11,代码来源:AbstractWebSocketBean.java

示例7: getDocumentEntryRepresentation

import lotus.domino.Name; //导入方法依赖的package包/类
public NameEntry getDocumentEntryRepresentation(Document docSearch) {
	try {

		String strDbPath = docSearch.getParentDatabase().getServer() + "!!" + docSearch.getParentDatabase().getFilePath();
		DominoDocument dDoc = DominoDocument.wrap(strDbPath, docSearch, "", "", false, "", "");

		Object[] objExec = { dDoc };
		String strLine = computeValueMB(m_BuildLine, objExec);
		if (strLine == null) {
			strLine = getField(docSearch, "InternetAddress");
		}
		String strValue = computeValueMB(m_BuildValue, objExec);
		if (strValue == null) {
			strValue = getField(docSearch, "FullName");
			Name non = docSearch.getParentDatabase().getParent().createName(strValue);
			strValue = non.getAbbreviated();
			non.recycle();
		}

		String strLabel = computeValueMB(m_BuildLabel, objExec);
		if (strLabel == null) {
			strLabel = getField(docSearch, "InternetAddress");
		}
		if (StringUtil.isEmpty(strValue)) {
			return null;
		}
		if (StringUtil.isEmpty(strLine)) {
			if (StringUtil.isEmpty(strLabel)) {
				strLine = strValue;
				strLabel = strValue;
			} else {
				strLine = strLabel;
			}
		}
		return new NameEntry(strValue, strLabel, strLine);

	} catch (Exception ex) {
		LoggerFactory.logError(getClass(), "General Error", ex);

	}
	return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:43,代码来源:UINamePicker.java

示例8: run1

import lotus.domino.Name; //导入方法依赖的package包/类
public void run1(final Session session) throws NotesException {
	Long sessId = getLotusId(session);
	sessionid.set(sessId);
	Database db = session.getDatabase("", "names.nsf");
	System.out.println("Db id:" + getLotusId(db));
	Name name = null;
	int i = 0;
	try {
		for (i = 0; i <= 100000; i++) {
			name = session.createName(UUID.randomUUID().toString());
			getLotusId(name);
			DateTime dt = session.createDateTime(new Date());
			getLotusId(dt);
			DateTime end = session.createDateTime(new Date());
			getLotusId(end);
			DateRange dr = session.createDateRange(dt, end);
			getLotusId(dr);
			Document doc = db.createDocument();
			getLotusId(doc);
			Item i1 = doc.replaceItemValue("Foo", dr);
			getLotusId(i1);
			Item i2 = doc.replaceItemValue("Bar", dr.getText());
			getLotusId(i2);
			Item i3 = doc.replaceItemValue("Blah", dr.getStartDateTime().getLocalTime());
			getLotusId(i3);
			lotus.domino.ColorObject color = session.createColorObject();
			getLotusId(color);
			color.setRGB(128, 128, 128);
			Item i4 = doc.replaceItemValue("color", color.getNotesColor());
			getLotusId(i4);
			i1.recycle();
			i2.recycle();
			i3.recycle();
			i4.recycle();
			DateTime create = doc.getCreated();
			getLotusId(create);
			@SuppressWarnings("unused")
			String lc = create.getLocalTime();
			//					if (i % 10000 == 0) {
			//						System.out.println(Thread.currentThread().getName() + " Name " + i + " is " + name.getCommon() + " "
			//								+ "Local time is " + lc + "  " + dr.getText());
			//					}
			dr.recycle();
			doc.recycle();
			dt.recycle();
			end.recycle();
			create.recycle();
			color.recycle();
			name.recycle();
		}
	} catch (Throwable t) {
		t.printStackTrace();
		System.out.println("Exception at loop point " + i);
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:56,代码来源:NotesRunner.java

示例9: processRequest

import lotus.domino.Name; //导入方法依赖的package包/类
/**
   * Processes requests for both HTTP
   * <code>GET</code> and
   * <code>POST</code> methods.
   *
   * @param request servlet request
   * @param response servlet response
   * @throws ServletException if a servlet-specific error occurs
   * @throws IOException if an I/O error occurs
* @throws  
   */
	
	

  protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
      response.setContentType("application/json;charset=UTF-8");
     
      try {
      	
      	for(String param: WebshellConstants.LOCATION_REQUIRED_PARAMS){
      		String value = request.getParameter(param);
      		if(value==null){
      			throw new IllegalArgumentException(param + " is a required query_string parameter.");
      		}
      	}
      	
      	Database db = ContextInfo.getUserDatabase();
      	String query = request.getParameter(WebshellConstants.PARAM_QUERY);
      	String xpage = request.getParameter(WebshellConstants.PARAM_XPAGE);
      	int max = Integer.parseInt(request.getParameter(WebshellConstants.PARAM_MAX));
      	
      	
      	//lets bind the docs to a location value object / POJO for easy json serialization by Jackson...
      	DocumentCollection col = db.FTSearch(query,max,Database.FT_DATECREATED_DES,Database.FT_FUZZY);
      	List<Location> list = new ArrayList<Location>(col.getCount());
      	Document doc = col.getFirstDocument();
      	Document temp = null;

      	while(doc!=null){
              
      		//build the location object
      		Location loc = new Location();
              loc.setLatitude(doc.getItemValueDouble(WebshellConstants.FIELD_LAT));
              loc.setLongitude(doc.getItemValueDouble(WebshellConstants.FIELD_LON));
              
              Name name = db.getParent().createName(doc.getItemValueString(WebshellConstants.FIELD_AUTHOR));
              loc.setTitle(name.getCommon());
              loc.setUrl(this.buildXpageUrl(request, xpage, doc));
              
              //add it to the list.
              list.add(loc);
              
              //notes cleanup
      		temp = col.getNextDocument(doc);
      		doc.recycle();
      		doc = temp;
      		name.recycle();
      	}

          //get the serialized json from the list.
          String json = MapperFactory.mapper().writeValueAsString(list);
          
          //apply cache headers if set by the cache param = true (i.e. &cache=true);
          this.setCacheHeader(request, response, json);
          
          //compress / send the response if supported by the browser (see parent WebshellServlet)
          this.compressResponse(request, response, json);
          
          
      } catch (NotesException e) {
	logger.log(Level.SEVERE,null, e);
}
  }
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:75,代码来源:RenderLocations.java


注:本文中的lotus.domino.Name.recycle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。