我正在编写一个简单的计时器方面来检测属于我的项目的所有包中的所有方法.但是,那些类中的各种方法的返回类型是不同的,我得到以下错误:
它只适用于制定者,但不适用于吸气剂......
错误:应用于不返回void的joinpoint
这是我的timeraspect......
@Around("execution(* com.myproject..*(..))")
public void log(ProceedingJoinPoint pjp) throws Throwable{
LOG.info("TimerAspect");
String name = pjp.getSignature().getName();
Monitor mon = MonitorFactory.start(name);
pjp.proceed();
mon.stop();
LOG.info("TimerAspect Mon" + mon);
String printStr = mon.getLabel()+","+mon.getUnits()+","+mon.getLastValue()+","+mon.getHits()+","+mon.getAvg()+","+mon.getTotal()+","+mon.getMin()+","+mon.getMax()+","+mon.getFirstAccess()+","+mon.getLastAccess();
File f = new File("target/stats.csv");
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(f, true));
bufferedWriter.write(printStr);
bufferedWriter.newLine();
bufferedWriter.flush();
bufferedWriter.close();
}
Run Code Online (Sandbox Code Playgroud)
任何解决这个问题的线索都非常感谢.
谢谢
简单。这是Maven pom.xml中的felix插件:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- allows the route to be ran via 'mvn camel:run' -->
<!-- <plugin> <groupId>org.apache.camel</groupId> <artifactId>camel-maven-plugin</artifactId>
<version>2.10.1</version> </plugin> -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>xyz</Bundle-SymbolicName>
<Export-Package>tutorial.simplerouter</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>`
Run Code Online (Sandbox Code Playgroud)
并且它不能正确生成MANIFEST.MF文件:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: rb
Build-Jdk: 1.6.0_35
Run Code Online (Sandbox Code Playgroud)
上面生成的manifest.mf不正确。
请告诉我为什么。
我想做以下......
a)将生成的UUID压缩为长度为8的String.
b)将压缩的UUID解压缩回原始UUID.
原因是因为我必须将UUID发送到伙伴系统,并且伙伴系统只接受UUID的8个字符,并且我不能请求更改伙伴系统.
因此,剩下的工作是将我所拥有的UUID压缩为8个字符串,然后在从伙伴系统返回消息时将其解压缩回原始UUID.
有任何想法吗?
谢谢.