inject

how to get my configuration values in yml - using dropwizard (microservice) Jersey D.I @Injection?

こ雲淡風輕ζ 提交于 2019-11-30 20:23:34
here's my code snippets. here's my yml file: productionServer: host: production-server.amazonaws.com publicIp: xx.xx.xx.xx privateIp: xx.xx.xx.xx userName: xx.xx.xx.xx password: xx.xx.xx.xx remoteFilePath: fake/path/ fileName: test.txt privateKey: private-public-key.ppk server: applicationConnectors: - type: http port: 8080 - type: https port: 8443 keyStorePath: key.keystore keyStorePassword: password validateCerts: false adminConnectors: - type: http port: 8081 - type: https port: 8444 keyStorePath: key.keystore keyStorePassword: password validateCerts: false MyConfiguration class: import io

Change Variable Value in JVM with GDB

只谈情不闲聊 提交于 2019-11-30 18:57:47
问题 Currently I have a simple Java program: public class Test { public static void main(String[] args) { boolean test = true; while (test) { System.out.println("Hello World"); try { Thread.sleep(1000); } catch (Exception e) {} } System.out.println("Bye-bye"); } } It prints "Hello World" every second. I would like to use gdb to attach to the process and make a memory patch to stop it with "Bye-bye" printed. I know GDB can get created VMs (JNI_GetCreatedVMs) from its console, the env object is also

Injecting into a Jersey Resource class

我与影子孤独终老i 提交于 2019-11-30 07:47:58
I did try going through the following links How to wire in a collaborator into a Jersey resource? and Access external objects in Jersey Resource class But still i am unable to find a working sample which shows how to inject into a Resource class. I am not using Spring or a web container. My Resource is package resource; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @Path("/something") public class Resource { @MyResource Integer foo = null; private static String response = "SampleData from Resource"; public

how to get my configuration values in yml - using dropwizard (microservice) Jersey D.I @Injection?

↘锁芯ラ 提交于 2019-11-30 04:47:59
问题 here's my code snippets. here's my yml file: productionServer: host: production-server.amazonaws.com publicIp: xx.xx.xx.xx privateIp: xx.xx.xx.xx userName: xx.xx.xx.xx password: xx.xx.xx.xx remoteFilePath: fake/path/ fileName: test.txt privateKey: private-public-key.ppk server: applicationConnectors: - type: http port: 8080 - type: https port: 8443 keyStorePath: key.keystore keyStorePassword: password validateCerts: false adminConnectors: - type: http port: 8081 - type: https port: 8444

Inject Spring beans into RestEasy

﹥>﹥吖頭↗ 提交于 2019-11-30 03:58:06
问题 Is it possible to inject Spring beans into an RestEasy @Path class? I managed to do it with Jersey, with @InjectParam annotation, but for some other reasons, I need to switch to RestEasy, and I can't seem to find a way to do it (tried good ol' javax.inject.Inject, but nothing). EDIT This solution works: http://www.mkyong.com/webservices/jax-rs/resteasy-spring-integration-example/ but it's not injection.. I'd still prefer something a little more elegant. 回答1: Simply annotate your RestEasy

Chrome Extension: How to detect if an extension is installed using Content Scripts

你说的曾经没有我的故事 提交于 2019-11-29 16:08:28
I am asking this question after looking at several related questions on stackoverflow. I started with how to detect if an extension is installed . I opted for the method where I add a div to body using content scripts on some pages. Here is how I did it... manifest.json { "name": "Install Check", "content_scripts": [ { "matches": ["http://host.com/*"], "js" : ["insert_node.js"] } ], "permissions": [ "tabs", "host.com/*" ] } insert_node.js (content script) var insert_node = document.createElement('div'); insert_node.id = "HOST_SITE"; document.body.appendChild(insert_node); host page <html>

Guice inject based on annotation value

你离开我真会死。 提交于 2019-11-29 14:12:16
I would like to use goolge/guice inject a value based on a class i provide with the annotation. AutoConfig annotation @BindingAnnotation @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.PARAMETER, ElementType.FIELD }) public @interface AutoConfig { // default null not possible Class<? extends Provider<? extends ConfigLoader<?>>> provider() default XMLAutoConfigProvider.class; } This is my annotation which allows configuring the type of config, that should be used for the annotated fields. Usecase: @AutoConfig() ConfigLoader<?> defaultConfig; @AutoConfig(provider = JsonConfigProvider)

Would ASLR cause friction for the address with DLL injection?

半世苍凉 提交于 2019-11-29 11:37:45
I was reading about the DLL injection technique, and I had this question in mind. Let us assume we want to inject a DLL into a destination process in Windows 7 which has ASLR enabled for kernel32.dll So any piece of the injected code can't use any winapi or any system call since the address of let's say loadLibrary function in the injector code will differ from the address loadLibrary in the destination process, Won't it ? So such a call to CreateRemoteThread won't work: CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ::GetProcAddress(hKernel32, "LoadLibraryA" ), pLibRemote, 0,

Injecting into a Jersey Resource class

微笑、不失礼 提交于 2019-11-29 10:11:12
问题 I did try going through the following links How to wire in a collaborator into a Jersey resource? and Access external objects in Jersey Resource class But still i am unable to find a working sample which shows how to inject into a Resource class. I am not using Spring or a web container. My Resource is package resource; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @Path("/something") public class Resource

Calling a function in an injected DLL?

倖福魔咒の 提交于 2019-11-29 04:42:36
Using C++, I have an application which creates a remote process and injects a DLL into it. Is there a way to get the remote application to execute a function exported from the DLL, from the application which created it? And is it possible to send parameters to that function? Please note that I am trying to stay away from doing anything within DllMain. RectangleEquals Note: For a much better answer, please see my update posted below ! Okay so here's how I was able to accomplish this: BOOL RemoteLibraryFunction( HANDLE hProcess, LPCSTR lpModuleName, LPCSTR lpProcName, LPVOID lpParameters, SIZE_T