Java Code Examples for org.aspectj.lang.JoinPoint#StaticPart
The following examples show how to use
org.aspectj.lang.JoinPoint#StaticPart .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractAspectJAdvice.java From spring-analysis-note with MIT License | 6 votes |
public void setArgumentNamesFromStringArray(String... args) { this.argumentNames = new String[args.length]; for (int i = 0; i < args.length; i++) { this.argumentNames[i] = StringUtils.trimWhitespace(args[i]); if (!isVariableName(this.argumentNames[i])) { throw new IllegalArgumentException( "'argumentNames' property of AbstractAspectJAdvice contains an argument name '" + this.argumentNames[i] + "' that is not a valid Java identifier"); } } if (this.argumentNames != null) { if (this.aspectJAdviceMethod.getParameterCount() == this.argumentNames.length + 1) { // May need to add implicit join point arg name... Class<?> firstArgType = this.aspectJAdviceMethod.getParameterTypes()[0]; if (firstArgType == JoinPoint.class || firstArgType == ProceedingJoinPoint.class || firstArgType == JoinPoint.StaticPart.class) { String[] oldNames = this.argumentNames; this.argumentNames = new String[oldNames.length + 1]; this.argumentNames[0] = "THIS_JOIN_POINT"; System.arraycopy(oldNames, 0, this.argumentNames, 1, oldNames.length); } } } }
Example 2
Source File: TIPSystemIntegrationModuleImpl.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
@Profiled( logFailuresSeparately = true, tag = "{$1}.TIPSystemIntegrationModuleImpl#registerData", logger = "org.perf4j.TimingLogger_Executor" ) public String registerData(byte[] singleMessage, String tipId, boolean requestPatientSignature, ThreeStateBoolean patientConsent) throws IntegrationModuleException { JoinPoint.StaticPart var10000 = ajc$tjp_2; Object[] var18 = new Object[]{singleMessage, tipId, Conversions.booleanObject(requestPatientSignature), patientConsent}; JoinPoint var17 = Factory.makeJP(var10000, this, this, (Object[])var18); TimingAspect var20 = TimingAspect.aspectOf(); Object[] var19 = new Object[]{this, singleMessage, tipId, Conversions.booleanObject(requestPatientSignature), patientConsent, var17}; ProceedingJoinPoint var10001 = (new TIPSystemIntegrationModuleImpl$AjcClosure5(var19)).linkClosureAndJoinPoint(69648); Annotation var10002 = ajc$anno$2; if (ajc$anno$2 == null) { var10002 = ajc$anno$2 = TIPSystemIntegrationModuleImpl.class.getDeclaredMethod("registerData", byte[].class, String.class, Boolean.TYPE, ThreeStateBoolean.class).getAnnotation(Profiled.class); } return (String)var20.doPerfLogging(var10001, (Profiled)var10002); }
Example 3
Source File: AbstractAspect.java From kieker with Apache License 2.0 | 6 votes |
/** * This is an advice which will be used after the construction of an object. * * @param thisObject * @param jp * The static information about this joint point. */ // HINT: This may be logged multiple times due to super constructor calls... @AfterReturning("monitoredConstructor() && this(thisObject) && notWithinKieker()") public void afterConstruction(final Object thisObject, final JoinPoint.StaticPart jp) { if (!CTRLINST.isMonitoringEnabled()) { return; } final Signature signature = jp.getSignature(); if (!CTRLINST.isProbeActivated(this.signatureToLongString(signature))) { return; } // common fields TraceMetadata trace = TRACEREGISTRY.getTrace(); final boolean newTrace = trace == null; if (newTrace) { trace = TRACEREGISTRY.registerTrace(); CTRLINST.newMonitoringRecord(trace); } final ConstructionEvent crecord = new ConstructionEvent(TIME.getTime(), trace.getTraceId(), trace.getNextOrderId(), signature.getDeclaringTypeName(), System.identityHashCode(thisObject)); CTRLINST.newMonitoringRecord(crecord); }
Example 4
Source File: RandomAccessFileWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 5 votes |
public void write(byte[] b, int off, int len, JoinPoint.StaticPart jp) throws IOException { DiskResource.Write.starting(this, len, jp, true); try { super.write(b, off, len); } finally { DiskResource.Write.finished(this, len, jp, true); } }
Example 5
Source File: NetworkInputStreamWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 5 votes |
public int read(byte[] b, int off, int len, JoinPoint.StaticPart jp) throws IOException { Read.starting(in, jp); int numRead = 0; try { return numRead = in.read(b, off, len); } finally { Read.finished(in, numRead, jp); } }
Example 6
Source File: RandomAccessFileWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 5 votes |
public void write(byte[] b, JoinPoint.StaticPart jp) throws IOException { DiskResource.Write.starting(this, b.length, jp, true); try { super.write(b); } finally { DiskResource.Write.finished(this, b.length, jp, true); } }
Example 7
Source File: FileInputStreamWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 5 votes |
public int read(JoinPoint.StaticPart jp, byte[] b, int off, int len) throws IOException { DiskResource.Read.starting(this, len, jp, true); int numRead = 0; try { return numRead = super.read(b, off, len); } finally { DiskResource.Read.finished(this, numRead, jp, true); } }
Example 8
Source File: RunContext.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** Called to indicate that a method such as run() or call() has begun. Due to subclassing and wrapping, this might * be called multiple times. Only the first invocation manipulates the baggage */ public void BeginExecution(JoinPoint.StaticPart jp) { // Only the first invocation manipulates the baggage if (reentry_count++ == 0) { XTraceReport.entering(jp); baggage = Baggage.swap(baggage); XTraceReport.left(jp); } }
Example 9
Source File: FileInputStreamWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 5 votes |
public void close(JoinPoint.StaticPart jp) throws IOException { DiskResource.Close.starting(this, jp, true); try { super.close(); } finally { DiskResource.Close.finished(this, jp, true); } }
Example 10
Source File: CommonsLogWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 4 votes |
public void save(JoinPoint.StaticPart joinPoint) { logSources.set(joinPoint); }
Example 11
Source File: NullImp.java From automon with Apache License 2.0 | 4 votes |
@Override public Object start(JoinPoint.StaticPart label) { return NOOP; }
Example 12
Source File: MethodInvocationProceedingJoinPoint.java From java-technology-stack with MIT License | 4 votes |
@Override public JoinPoint.StaticPart getStaticPart() { return this; }
Example 13
Source File: Micrometer.java From automon with Apache License 2.0 | 4 votes |
@Override public TimerContext start(JoinPoint.StaticPart jp) { return new TimerContext(jp); }
Example 14
Source File: _TestTypes.java From spring4-understanding with Apache License 2.0 | 4 votes |
public void needsJoinPointStaticPart(JoinPoint.StaticPart tjpsp) { this.collaborator.needsJoinPointStaticPart(tjpsp.getSignature().getName()); }
Example 15
Source File: FileInputStreamWrapper.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 4 votes |
public FileInputStreamWrapper(FileDescriptor fdObj, JoinPoint.StaticPart jp) { super(fdObj); this.creator = jp; }
Example 16
Source File: JavaSimon.java From automon with Apache License 2.0 | 4 votes |
@Override public Split start(JoinPoint.StaticPart jp) { return SimonManager.getStopwatch(cleanSpaces(jp.toString())).start(); }
Example 17
Source File: RWLockResource.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 4 votes |
public void release(long request_hrt, long acquire_hrt, long release_hrt, JoinPoint.StaticPart jp) { if (aggregator.enabled()) aggregator.finished(op, Retro.getTenant(), release_hrt - acquire_hrt, release_hrt - request_hrt); if (xtrace.valid()) xtrace.log(jp, rel, "Operation", rel, "LockID", lockid, "LockRequest", request_hrt, "LockAcquire", acquire_hrt); }
Example 18
Source File: Metrics.java From automon with Apache License 2.0 | 4 votes |
@Override public Timer start(JoinPoint.StaticPart jp) { return metrics.timer(name(jp.toString())); }
Example 19
Source File: MonitorLock.java From tracing-framework with BSD 3-Clause "New" or "Revised" License | 4 votes |
public static void acquiring(Object lock, JoinPoint.StaticPart jp) { if (AGGREGATION_ENABLED) LocalResources.getLockAggregator(lockName(lock, jp)).requesting(Retro.getTenant()); CPUTracking.pauseTracking(); }
Example 20
Source File: Utils.java From automon with Apache License 2.0 | 2 votes |
/** * @param jp The pointcut from the @Around advice that was intercepted. * @return A label suitable for a monitoring/timer label. It is a convenience method and need not be * used to create the monitor */ public static String getLabel(JoinPoint.StaticPart jp) { return jp.toString(); }