1、查看开启的端口 firewall-cmd --list-port 2、开启一个端口 firewall-cmd --zone=public --add-port=8080/tcp --permanent 3、关闭一个端口 firewall-cmd --zone=public --remove-port=8080/tcp --permanent 4、重启防火墙 firewall-cmd --reload 5、开启、关闭防火墙 systemctl start firewalld systemctl stop firewalld 有更新! centos开启防火墙端口 服务器
1、定义类注解和方法注解 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface TypeAnnotation { String value() default "这是类注解"; } @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface MethodAnnotation { String value() default "这是方法注解"; } 2、处理注解 此处通过反射拿到类对象,获取注解,来操作。 再生产中也可以结合切面编程来处理注解,或者扫描指定包下的所有类,遍历处理注解 public class AnnotationHandler { public static void main(String[] args){ //可以配置扫描路径加载所有class,也可以使用aspectj直接做前面处理 Class aClass .... 有更新! 自己定义一个注解 程序人生
1、安装gcc yum install gcc-c++ -y 2、redis下载解压 wget http://download.redis.io/releases/redis-5.0.8.tar.gz tar xzf redis-5.0.8.tar.gz cd redis-5.0.8 3、编译 make 4、启动 进入src目录,运行redis-serve即可 有更新! centos安装redis 程序人生