注释1:
直接执行slice2java wasptrans.ice。当时报了一大堆错误,例如:
wasptrans.ice:7: No include path in which to find wasp.ice
wasptrans.ice:20: `FeeWay' is not defined
wasptrans.ice:30: `UserInfo' is not defined
wasptrans.ice:31: `ProductInfo' is not defined
......
即找不到wasp.ice里面定义的许多类。
后来用slice2java -I. wasptrans.ice就可以解决这个问题。 “-I” 是告诉编译器在编译的时候要包含
路径,“.”指当前目录。合在一起“-I.” 就相当于指定当前目录也是其在编译过程中查找的路径。还
有其他多种参数可以在编译的时候使用,可以用slice2java -h进行查看。
mqq@dev_bj_kevinzhao:~/wasp/interface$ slice2java -h
Usage: slice2java [options] slice-files...
Options:
-h, --help Show this message.
-v, --version Display the Ice version.
-DNAME Define NAME as 1.
-DNAME=DEF Define NAME as DEF.
-UNAME Remove any definition for NAME.
-IDIR Put DIR in the include file search path.
--output-dir DIR Create files in the directory DIR.
--tie Generate TIE classes.
--impl Generate sample implementations.
--impl-tie Generate sample TIE implementations.
--depend Generate Makefile dependencies.
-d, --debug Print debug messages.
--ice Permit `Ice' prefix (for building Ice source code only)
--checksum CLASS Generate checksums for Slice definitions into CLASS.
--stream Generate marshaling support for public stream API.
public QueryPrx getQueryPrx( Communicator communicator )
{
QueryPrx query = null;
query = QueryPrxHelper.checkedCast(communicator.stringToProxy("IcePack/Query"));
if (query == null)
{
System.out.println("ICE get query by properties is null!!!!!!");
}
return query;
}
public int destory(Communicator communicator)
{
int result = 0;
try
{
communicator.destroy();
}
catch(Ice.LocalException ex)
{
ex.printStackTrace();
result = 1;
}
return result;
}
}
注释5:
出现错误:
IcePack.ObjectNotExistException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow
(BasicStream.java:2011)
at IceInternal.BasicStream.throwException(BasicStream.java:1413)
at IcePack._QueryDelM.findObjectByType(_QueryDelM.java:143)
at IcePack.QueryPrxHelper.findObjectByType(QueryPrxHelper.java:99)
at IcePack.QueryPrxHelper.findObjectByType(QueryPrxHelper.java:84)
at com.tencent.wasp.ice.proxy.CallICE.main(CallICE.java:41)
同生成的做法一样,添加和移除类成员只要去修改fields和methods中的元素即可。这里我们拿一个简单的类做例子,下面这个Task类,我们来移除isNeedRemove方法,并且添加一个int 类型的addedField属性。
package asm.core;
/**
* Created by yunshen.ljy on 2015/6/
交换两个数字的方法有以下三种 ,其中第一种最常用
/*
输出最小的一个数
*/
public class jiaohuan1 {
public static void main(String[] args) {
int a =4;
int b = 3;
if(a<b){
// 第一种交换方式
int tmep =
1. Kafka提供了两种Consumer API
High Level Consumer API
Low Level Consumer API(Kafka诡异的称之为Simple Consumer API,实际上非常复杂)
在选用哪种Consumer API时,首先要弄清楚这两种API的工作原理,能做什么不能做什么,能做的话怎么做的以及用的时候,有哪些可能的问题
CompositeChannelBuffer体现了Netty的“Transparent Zero Copy”
查看API(
http://docs.jboss.org/netty/3.2/api/org/jboss/netty/buffer/package-summary.html#package_description)
可以看到,所谓“Transparent Zero Copy”是通
// this need android:minSdkVersion="11"
getActionBar().setDisplayHomeAsUpEnabled(true);
@Override
public boolean onOptionsItemSelected(MenuItem item) {
$(document).ready(function () {
var request = {
QueryString :
function (val) {
var uri = window.location.search;
var re = new RegExp("" + val + "=([^&?]*)", &
ArticleSelect类在命名空间HoverTree.Model中可以认为是文章查询条件类,用于存放查询文章时的条件,例如HvtId就是文章的id。HvtIsShow就是文章的显示属性,当为-1是,该条件不产生作用,当为0时,查询不公开显示的文章,当为1时查询公开显示的文章。HvtIsHome则为是否在首页显示。HoverTree系统源码完全开放,开发环境为Visual Studio 2013
1. php 类
I found this class looking for something else actually but I remembered I needed some while ago something similar and I never found one. I'm sure it will help a lot of developers who try to
Design pattern for graph processing.
Since we consider a large number of graph-processing algorithms, our initial design goal is to decouple our implementations from the graph representation