博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年11月1日

摘要: 1packagecom.karl.test;23publicclassTestEnum{45publicenumColorSelect{6red,green,yellow,blue;7}89publicenumSeason{10spring,summer,fall,winter;11privatefinalstaticStringlocation="Phoenix";1213publicstaticSeasongetBest(){14if(location.endsWith("Phoenix"))15returnwinter;16else17return 阅读全文

posted @ 2011-11-01 22:00 钟悍 阅读(257) 评论(0) 推荐(0) 编辑

摘要: /*** 被拦截的方法* /@Interceptors(CAProxyExceptionInterceptor.class)publicvoidprocessMessage(NotificationMessagemsg)throwsException{ //todo}/*** 执行拦截的类* /publicclassCAProxyExceptionInterceptor{ /** * 拦截方法 */ @AroundInvokepublicObjecthandleException(InvocationContextctx)throwsException{ Objecto=nul... 阅读全文

posted @ 2011-11-01 16:56 钟悍 阅读(261) 评论(0) 推荐(0) 编辑

摘要: publicvoiddisableExpireDeviceIds(List<String>deviceIds){Queryq=entityManager.createQuery("UPDATECADeviceEntitySETstatus=0WHEREdeviceIdin(:deviceIds)");q.setParameter("deviceIds",deviceIds);q.executeUpdate();LOGGER.debug("CAProxyDeviceDbMangerImpl.disableExpireDevice&qu 阅读全文

posted @ 2011-11-01 16:46 钟悍 阅读(385) 评论(0) 推荐(0) 编辑

摘要: @EJB (beanName = "CAProxySubMessageHandlerImpl")private CAProxyMessageHandler subscriptionHandler;packagekarl.common.ejb;importkarl.event.NotificationMessage;publicinterfaceCAProxyMessageHandler{publicvoidprocessMessage(NotificationMessagemsg)throwsException;}packagekarl.message;importjava 阅读全文

posted @ 2011-11-01 16:33 钟悍 阅读(315) 评论(0) 推荐(0) 编辑

摘要: #include<iostream>#include<string>using namespace std;class A{public: virtual void fun1()=0; //纯虚函数 virtual void fun1(){cout<<"A::fun1"<<endl;} //虚函数 void fun2(){cout<<"A::fun2"<<endl;} //函数};class B:public A{public: void fun0(){cout<<&qu 阅读全文

posted @ 2011-11-01 16:19 钟悍 阅读(1449) 评论(2) 推荐(0) 编辑