List of usage examples for java.lang System identityHashCode
@HotSpotIntrinsicCandidate public static native int identityHashCode(Object x);
From source file:org.apache.axis2.description.ParameterIncludeImpl.java
/** * Debug for for property key and value. * @param key/* w w w . j a v a 2 s . c o m*/ * @param value */ private void debugParameterAdd(Parameter parameter) { if (DEBUG_PROPERTY_SET) { String key = parameter.getName(); Object value = parameter.getValue(); String className = (value == null) ? "null" : value.getClass().getName(); String classloader = "null"; if (value != null) { ClassLoader cl = Utils.getObjectClassLoader(value); if (cl != null) { classloader = cl.toString(); } } String valueText = (value instanceof String) ? value.toString() : null; String identity = getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(this)); log.debug("=================="); log.debug(" Parameter add on object " + identity); log.debug(" Key =" + key); if (valueText != null) { log.debug(" Value =" + valueText); } log.debug(" Value Class = " + className); log.debug(" Value Classloader = " + classloader); log.debug("Call Stack = " + JavaUtils.callStackToString()); log.debug("=================="); } }
From source file:org.compass.core.lucene.engine.transaction.async.AsyncTransactionProcessorFactory.java
/** * Adds the {@link org.compass.core.lucene.engine.transaction.support.job.TransactionJobs} to be processed * asynchronously. If a procesing threads has not started, will start it (it is started lazily so if the * async transaction processor is not used, it won't incur any overhead). * * <p>The addition of {@link org.compass.core.lucene.engine.transaction.support.job.TransactionJobs} is "offered" * to a blocking queue, waiting until the queue if cleared in case it is full. This will cause a transaction * commit to block if the backlog is full. The time to wait can be controlled using * {@link org.compass.core.lucene.LuceneEnvironment.Transaction.Processor.Async#ADD_TIMEOUT} and defaults to * 10 seconds./*from ww w . java 2 s. c o m*/ */ public void add(TransactionJobs jobs) throws SearchEngineException { if (pollingProcessor == null) { synchronized (this) { if (pollingProcessor == null) { this.pollingProcessor = new PollingProcessor(); pollingProcessorFuture = searchEngineFactory.getExecutorManager().submit(pollingProcessor); } } } try { boolean offered = jobsToProcess.offer(jobs, addTimeout, TimeUnit.MILLISECONDS); if (!offered) { throw new SearchEngineException("Failed to add jobs [" + System.identityHashCode(jobs) + "], queue is full and nothing empties it"); } } catch (InterruptedException e) { throw new SearchEngineException( "Failed to add jobs [" + System.identityHashCode(jobs) + "], interrupted", e); } }
From source file:net.sf.jasperreports.engine.fill.JRFillBand.java
protected int getId() { //FIXME this is not necessarily unique return System.identityHashCode(this); }
From source file:org.apache.ranger.plugin.policyengine.RangerPolicyEngineImpl.java
@Override public RangerAccessResult isAccessAllowed(RangerAccessRequest request, RangerAccessResultProcessor resultProcessor) { if (LOG.isDebugEnabled()) { LOG.debug("==> RangerPolicyEngineImpl.isAccessAllowed(" + request + ")"); }/*from www . j a v a2 s .c om*/ RangerPerfTracer perf = null; if (RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_REQUEST_LOG)) { perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_REQUEST_LOG, "RangerPolicyEngine.isAccessAllowed(requestHashCode=" + Integer.toHexString(System.identityHashCode(request)) + ")"); } RangerAccessResult ret = isAccessAllowedNoAudit(request); updatePolicyUsageCounts(request, ret); if (resultProcessor != null) { RangerPerfTracer perfAuditTracer = null; if (RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_AUDIT_LOG)) { perfAuditTracer = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_AUDIT_LOG, "RangerPolicyEngine.processAudit(requestHashCode=" + Integer.toHexString(System.identityHashCode(request)) + ")"); } resultProcessor.processResult(ret); RangerPerfTracer.log(perfAuditTracer); } RangerPerfTracer.log(perf); if (LOG.isDebugEnabled()) { LOG.debug("<== RangerPolicyEngineImpl.isAccessAllowed(" + request + "): " + ret); } return ret; }
From source file:org.openvpms.tools.data.loader.LoadState.java
/** * Adds a deferred updater to the cache, and propagates it to the parent, * if present./*from w ww . j a v a 2 s. co m*/ * * @param updater the deferred updater */ private void addDeferredCache(DeferredUpdater updater) { deferredCache.put(System.identityHashCode(updater), updater); if (parent != null) { parent.addDeferredCache(updater); } }
From source file:com.simiacryptus.mindseye.applications.ObjectLocationBase.java
/** * Gets shuffle comparator.//from ww w . ja v a 2s.co m * * @param <T> the type parameter * @return the shuffle comparator */ public <T> Comparator<T> getShuffleComparator() { final int seed = (int) ((System.nanoTime() >>> 8) % (Integer.MAX_VALUE - 84)); return Comparator.comparingInt(a1 -> System.identityHashCode(a1) ^ seed); }
From source file:org.asteriskjava.live.internal.AsteriskQueueImpl.java
@Override public String toString() { final StringBuffer sb; sb = new StringBuffer("AsteriskQueue["); sb.append("name='").append(getName()).append("',"); sb.append("max='").append(getMax()).append("',"); sb.append("strategy='").append(getStrategy()).append("',"); sb.append("serviceLevel='").append(getServiceLevel()).append("',"); sb.append("weight='").append(getWeight()).append("',"); sb.append("calls='").append(getCalls()).append("',"); sb.append("holdTime='").append(getHoldTime()).append("',"); sb.append("talkTime='").append(getTalkTime()).append("',"); sb.append("completed='").append(getCompleted()).append("',"); sb.append("abandoned='").append(getAbandoned()).append("',"); sb.append("serviceLevelPerf='").append(getServiceLevelPerf()).append("',"); synchronized (entries) { sb.append("entries='").append(entries.toString()).append("',"); }//from ww w. ja v a 2s . com synchronized (members) { sb.append("members='").append(members.toString()).append("',"); } sb.append("systemHashcode=").append(System.identityHashCode(this)); sb.append("]"); return sb.toString(); }
From source file:org.artifactory.config.CentralConfigServiceImpl.java
private void setDescriptor(CentralConfigDescriptor descriptor, boolean save) { log.trace("Setting central config descriptor for config #{}.", System.identityHashCode(this)); if (save) {/*from w ww.j a v a 2 s .c o m*/ assertSaveDescriptorAllowd(); // call the interceptors before saving the new descriptor interceptors.onBeforeSave(descriptor); } this.descriptor = descriptor; checkUniqueProxies(); //Create the date formatter String dateFormat = descriptor.getDateFormat(); dateFormatter = DateTimeFormat.forPattern(dateFormat); //Get the server name serverName = descriptor.getServerName(); if (serverName == null) { log.debug("No custom server name in configuration. Using hostname instead."); try { serverName = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { log.warn("Could not use local hostname as the server instance id: {}", e.getMessage()); serverName = "localhost"; } } if (save) { log.info("Saving new configuration in storage..."); String configString = JaxbHelper.toXml(descriptor); configsService.addOrUpdateConfig(ArtifactoryHome.ARTIFACTORY_CONFIG_FILE, configString); log.info("New configuration saved."); } }
From source file:org.jabsorb.JSONRPCBridge.java
/** * Adds a reference to the map of known references * * @param o The object to be added//w w w . j a v a 2 s . co m */ public void addReference(Object o) { synchronized (referenceMap) { referenceMap.put(new Integer(System.identityHashCode(o)), o); } }
From source file:com.tmall.wireless.tangram3.dataparser.concrete.Card.java
public void setCells(@Nullable List<BaseCell> cells) { if (mPlaceholderCell != null) this.mCells.remove(mPlaceholderCell); oldMap.clear();//from w w w .j a va 2 s.c o m pendingDeleteMap.clear(); for (BaseCell cell : this.mCells) { oldMap.put(System.identityHashCode(cell), cell); } this.mCells.clear(); if (cells != null) { for (BaseCell c : cells) { //noinspection unchecked this.addCellInternal(c, true); } } adjustPendingCells(true); newMap.clear(); for (BaseCell cell : this.mCells) { newMap.put(System.identityHashCode(cell), cell); } for (int i = 0, size = oldMap.size(); i < size; i++) { int key = oldMap.keyAt(i); if (newMap.get(key) != null) { newMap.remove(key); pendingDeleteMap.put(key, true); } } for (int i = 0, size = pendingDeleteMap.size(); i < size; i++) { oldMap.remove(pendingDeleteMap.keyAt(i)); } diffCells(newMap, oldMap); newMap.clear(); oldMap.clear(); pendingDeleteMap.clear(); if (requirePlaceholderCell()) { this.mCells.add(mPlaceholderCell); } }