我正在尝试使用现有的 Java 类来创建使用 Axis2 的 Web 服务。
当我向 Web 服务发送请求时,Axis2 显示以下消息:
[01 Nov 2012 16:37:05:244] classloader.BeanInfoCache: Unable to locate a BeanInfo cache for class ems.shared.Fti (stopClass=class java.lang.Object). This will negatively affect performance!
我不确定这个错误是什么意思,但这让我想知道 ems.shared.Fti 类是否不能满足成为 Java Bean 的所有要求。你能看出这门课有什么问题吗?
package ems.shared;
import java.io.Serializable;
public class Fti implements Serializable
{
private static final long serialVersionUID = 7476379431395094501L;
public static final Fti UNDEFINED = new Fti(-1);
public static final Fti BROADCAST = new Fti((int) (Math.pow(2, 20) - 2));
private int fti;
public Fti() {
}
public Fti(int fti)
{
this.fti = fti;
}
public Fti(String fti)
{
try
{
this.fti = Integer.parseInt(fti);
}
catch (NumberFormatException e)
{
throw new IllegalArgumentException(fti + " is not a valid FTI");
}
}
public void setFti(int fti) {
this.fti = fti;
}
public int getFti() {
return fti;
}
public int asInt()
{
return this.fti;
}
@Override
public String toString()
{
return String.valueOf(fti);
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + fti;
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Fti other = (Fti) obj;
if (fti != other.fti)
return false;
return true;
}
}