ylbtech-Java-Class-@I:javax.annotation.PostConstruct
1.返回顶部
 
2.返回顶部
1.1、
package com.ylbtech.api.platform.controller.pay;

import com.egzosn.pay.ali.api.AliPayConfigStorage;
import com.egzosn.pay.ali.api.AliPayService;
import com.egzosn.pay.ali.bean.AliTransactionType;
import com.egzosn.pay.common.api.PayService;
import com.egzosn.pay.common.bean.PayOrder;
import com.egzosn.pay.common.http.HttpConfigStorage;
import com.egzosn.pay.common.util.sign.SignUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map; /**
* 发起支付入口
*/
@RestController
@RequestMapping("ali")
public class AliPayController { private PayService service = null; @Autowired
private IOrganizationOrderService orderService; @PostConstruct
public void init() {
AliPayConfigStorage aliPayConfigStorage = new AliPayConfigStorage();
//aliPayConfigStorage.setPid("xxx");
aliPayConfigStorage.setAppid("xxx");
aliPayConfigStorage.setKeyPublic("xxx");
aliPayConfigStorage.setKeyPrivate("xxx");
aliPayConfigStorage.setNotifyUrl("xxx");
aliPayConfigStorage.setReturnUrl("xxx"); aliPayConfigStorage.setSignType(SignUtils.RSA2.name());
//aliPayConfigStorage.setSeller("xxx");
aliPayConfigStorage.setInputCharset("utf-8");
//是否为测试账号,沙箱环境
aliPayConfigStorage.setTest(false); //请求连接池配置
HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
//最大连接数
httpConfigStorage.setMaxTotal(20);
//默认的每个路由的最大连接数
httpConfigStorage.setDefaultMaxPerRoute(10);
service = new AliPayService(aliPayConfigStorage, httpConfigStorage);
//增加支付回调消息拦截器
//service.addPayMessageInterceptor(new AliPayMessageInterceptor());
//设置回调消息处理
//service.setPayMessageHandler(spring.getBean(AliPayMessageHandler.class));
} }
1.2、
3.返回顶部
 
4.返回顶部
1、
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/ package javax.annotation; import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*; /**
* The PostConstruct annotation is used on a method that needs to be executed
* after dependency injection is done to perform any initialization. This
* method MUST be invoked before the class is put into service. This
* annotation MUST be supported on all classes that support dependency
* injection. The method annotated with PostConstruct MUST be invoked even
* if the class does not request any resources to be injected. Only one
* method can be annotated with this annotation. The method on which the
* PostConstruct annotation is applied MUST fulfill all of the following
* criteria:
* <p>
* <ul>
* <li>The method MUST NOT have any parameters except in the case of
* interceptors in which case it takes an InvocationContext object as
* defined by the Interceptors specification.</li>
* <li>The method defined on an interceptor class MUST HAVE one of the
* following signatures:
* <p>
* void <METHOD>(InvocationContext)
* <p>
* Object <METHOD>(InvocationContext) throws Exception
* <p>
* <i>Note: A PostConstruct interceptor method must not throw application
* exceptions, but it may be declared to throw checked exceptions including
* the java.lang.Exception if the same interceptor method interposes on
* business or timeout methods in addition to lifecycle events. If a
* PostConstruct interceptor method returns a value, it is ignored by
* the container.</i>
* </li>
* <li>The method defined on a non-interceptor class MUST HAVE the
* following signature:
* <p>
* void <METHOD>()
* </li>
* <li>The method on which PostConstruct is applied MAY be public, protected,
* package private or private.</li>
* <li>The method MUST NOT be static except for the application client.</li>
* <li>The method MAY be final.</li>
* <li>If the method throws an unchecked exception the class MUST NOT be put into
* service except in the case of EJBs where the EJB can handle exceptions and
* even recover from them.</li></ul>
* @since Common Annotations 1.0
* @see javax.annotation.PreDestroy
* @see javax.annotation.Resource
*/
@Documented
@Retention (RUNTIME)
@Target(METHOD)
public @interface PostConstruct {
}
2、
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Java-Class-@I:javax.annotation.PostConstruct的更多相关文章

  1. Java-API-Package:javax.annotation

    ylbtech-Java-API-Package:javax.annotation 1.返回顶部 1. Package javax.annotation Enum Summary Resource.A ...

  2. JAVA提高五:注解Annotation

    今天我们学习JDK5.0中一个非常重要的特性,叫做注解.是现在非常流行的一种方式,可以说因为配置XML 比较麻烦或者比容易查找出错误,现在越来越多的框架开始支持注解方式,比如注明的Spring 框架, ...

  3. java 编程基础:注解(Annotation Processing Tool)注解处理器 利用注解解读类属性生成XML文件

    APT的介绍: APT(Annotation Processing Tool)是一种注解处理工具,它对源代码文件进行检测,并找出源文件所包含的注解信息,然后针对注解信息进行额外的处理. 使用APT工具 ...

  4. Java学习笔记:注解Annotation

    annotation的概念 In the Java computer programming language, an annotation is a form of syntactic metada ...

  5. 记一次部署时报java.lang.NoSuchMethodError:javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax / persistence / ValidationMode;的解决办法

    楼主在部署war包的时候,本地启动不报错,服务器商报如下问题: Error creating bean with name 'entityManagerFactory' defined in clas ...

  6. java.lang.NoSuchMethodError:javax.validation.BootstrapConfiguration.getClockProviderClassName

    Spring Boot 2随附了hibernate-validator 6(org.hibernate.validator:hibernate-validator:6.0.16.Final依赖于val ...

  7. 【转载:java】详解java中的注解(Annotation)

    目录结构: contents structure [+] 什么是注解 为什么要使用注解 基本语法 4种基本元注解 重复注解 使用注解 运行时处理的注解 编译时处理的注解 1.什么是注解 用一个词就可以 ...

  8. Kubernetes官方java客户端之六:OpenAPI基本操作

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

  9. Spring源码学习之: 通过Spring @PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作

    关于在spring  容器初始化 bean 和销毁前所做的操作定义方式有三种: 第一种:通过@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作 第二 ...

随机推荐

  1. BZOJ 3105: [cqoi2013]新Nim游戏(线性基)

    解题思路 \(nim\)游戏先手必胜的条件是异或和不为\(0\),也就是说第一个人拿走了若干堆后不管第二个人怎么拿都不能将剩余堆的异或和变成\(0\).考虑线性基,其实就是每个数对线性基都有贡献,任何 ...

  2. SQL必知必会——插入数据(十五)

    1.数据插入 INSERT用来将行插入(或添加)到数据库表.插入有几种方式: 插入完整的行插入行的一些部分插入某些查询的结果注意:1.使用INSERT语句可能需要客户端/服务端DBMS中的特定安全权限 ...

  3. TP5.0 where数组高级查询

    多条件模糊查询多条件比较查询使用数组可以方便得将一些比较复杂的查询条件 , 组合到一个数组之内 如以下数据库查询 $subjectList = Db::name('user_apply') -> ...

  4. Webx.0-Web4.0:Web4.0

    ylbtech-Webx.0-Web4.0:Web4.0 Web系统是人类迄今最伟大的发明之一,也是计算机影响人类最深远的表现. 1.返回顶部 1. Web系统是人类迄今最伟大的发明之一,也是计算机影 ...

  5. JS-插件编写

    # 参数处理 JS: function plugin_mian_func(options){ var defaluts = { opt1: 'opt1', opt2: 'opt2', opt3: { ...

  6. Jmeter_Beanshell 返回值中提取参数值

    Jmeter_Beanshell  返回值中提取参数值[准备环境]: ①Jmeter版本:5.1,JDK:1.8 ②前置条件:将json.jar包置于..\apache-jmeter-5.1\lib\ ...

  7. Windows 08 R2_NLB负载均衡(图文详解)

    目录 目录 Load Balance 使用NLB来部署Web Farm集群 环境准备 在Win08r2pc1中配置DNS服务 在Win08r2pc1中部署File Service文件服务 在Win08 ...

  8. PowerDesigner小技巧(整理中)

    1.在修改name的时候,code的值将跟着联动 修改方法:PowerDesign中的选项菜单里修改,在[Tool]-->[General Options]->[Dialog]->[ ...

  9. 9. Jmeter-前置处理器

    jmeter-前置处理器介绍与使用 JSR223 PreProcessor 用户参数 HTML链接解析器 HTTP URL 重写修饰符 JDBC PreProcessor RegEx User Par ...

  10. 原生js星星评分源码

    html: <div id="fiveStars"> <div>到场时间:<img v-for="(star,index) in stars ...